- Allows you and one other person to be paid for each item sale
- Sends an IM to your partner about what was sold and by whom
Enjoy!
CODE
//Writen by MCM Villiers
//Based on a script by revochen Mayne
key partnerid = ""; //your partners KEY not name
integer pay = 10; // item price (if left at 10 it would sell for 10 lindens
float comission=50; // % comission your partner will make
//only scripters that know what they are doing with vendors edit below or edit at your own risk!
default
{
state_entry()
{
llSetText("",<1,1,1>,.75);
}
touch_start(integer num_detected)
{
if(llDetectedKey(0)==llGetOwner())
{
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_DEBIT)
{
llOwnerSay("Permissions passed...ready to work");
state run;
}
else
{
llOwnerSay("Invalid Permissions...resetting now");
llResetScript();
}
}
}
state run
{
state_entry()
{
llSetPayPrice(PAY_HIDE, [pay, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
string obj = llGetInventoryName(INVENTORY_OBJECT, 0);
if(obj != "")
{
llOwnerSay(obj + " is ready to be sold!");
llSetText("Pay the vendor to buy " + obj + " for " + (string)pay +"L$", <1,1,1>, 1);
}
else
{
llOwnerSay("/me found no items to sell! Please put some in and touch again!");
llResetScript();
}
}
money(key id, integer amount)
{
if (amount == pay)
{
llInstantMessage(id,"Thank you for your purchase!");
string obj = llGetInventoryName(INVENTORY_OBJECT, 0);
llGiveInventory(id, obj);
float percentage = (float)pay/100*comission;
llGiveMoney(partnerid,(integer)percentage);
llInstantMessage(partnerid,llKey2Name(id)+" bought a " + obj + " :)");
}
}
changed(integer change)
{
if(change & CHANGED_INVENTORY)
{
llOwnerSay("Iventory changed....resetting...");
llResetScript();
}
}
}

