Second Life Copybot
comission script - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: Business Scripts (https://secondlifecopybot.com/forum-44.html)
+----- Thread: comission script (/thread-638.html)



comission script - steadymobbin - 02-18-2013

PHP Code:
// GM-VENDOR TO SELL OBJECTS
// THIS NICE WORK WAS DONE BY RICKY NOEL
// 
// THIS CODE IS COPYRIGHT PROTECTED BY LAW
// MAY 31TH 2007 ALPHA COASTERS INC. 
  
// enter here the Price of the Object
integer price=79;

// enter here the Product wich a People will get after Paying Object
string product=Male Skin TGA Files"; 

// enter here the persons Key wich will get the Money
key partner ="
5bf4a61e-347e-49b8-b4f8-c2949d6f484f";

// enter here the Hovering Text wich will be Displayed
string DISPLAYTEXT="
Pay me to get the object";

// enter here the Percent wich your Partner will get
integer cpercent = 50;





integer commission;
integer payment;

/////////////////////
//    CONSTANTS    //
/////////////////////
integer PERMST=FALSE;
 
default
{
    state_entry()
    {
        llSetText("", <255.0,255.0,64.0>, 1);
        llGetOwner();
        llSetPayPrice(PAY_HIDE, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
        if(PERMST==TRUE){ 
        state run;}
        llSetTimerEvent(5.0);
    }
    
    touch_start(integer total_number)
    {
        llInstantMessage(llGetOwner(),llDetectedKey(0));
        if(llGetOwner() == llDetectedKey(0)){
        if(PERMST==FALSE){  
        state perms;
        } else {state run;}}
    }
    
    timer()
    {
     if(PERMST==FALSE){  
        state perms;
        } else {state run;}   
    }
}



state run
{
    state_entry()
    {
    llSetText(DISPLAYTEXT, <255.0,255.0,64.0>, 1);
    llSetPayPrice(PAY_HIDE, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
}
    
    money(key payer, integer amount)
    {
        if (amount == price)
        {   
        commission = (amount * cpercent) / 100;
        payment = amount - commission;
        llGiveMoney(partner, payment);
        llInstantMessage(payer,"
Thanks for your Purchaseyou should receive your Item in a few seconds");
        llGiveInventory(payer,product);
        }         
        
        
        if (amount < price)
        {
            llInstantMessage(payer, "
Im sorrybut that is not enough for the item.");
            llGiveMoney(payer, amount);
        }
        
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_DEBIT)
        {  
        }
        else
        {
            llOwnerSay("
Sorryyou must click [Yesin order for this to workReset Display now.");
            state black_hole;
        }
    }

}


state perms {
    state_entry() {
        llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);  
        PERMST=TRUE;
        state default;
    }   
    
}

state black_hole
{
    state_entry()
    {
        llResetScript();
    }