comission script

Thread Started By steadymobbin

2784
0
  • 46 Vote(s) - 3.07 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
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();
    }

[Image: guns-bullet-shirt_recreated.jpg]
Reply




Forum Jump:

1 Guest(s)
Share this:

About Second Life Copybot

Second Life CopyBot Forum is a place where you can get items for Second Life and other vitual worlds for free. With our CopyBot viewers you can export and import any content from these virtual worlds and modify them in 3D software such as Blender, 3D studio Macx etc...