Bonjour,
J'ai un script de vente par distribution % et lorsque le client veut payer l'objet, ça lui demande la permission. Aucun problème pour le moment, mais si le client dis non pour se rétracter.... la question lui est continuellement posée et ne s'arrête jamais jusqu'à ce qu'il accepte!
Voici le script en question :
integer price;
key ida;
key idb;
float pca;
float pcb;
key buyer_id;
give_items()
{
integer i;
list give;
list item_give;
integer do_individual = FALSE;
for ( i=0 ; i<llGetInventoryNumber( INVENTORY_ALL ) ; i++ )
{
string iname = llGetInventoryName( INVENTORY_ALL, i );
if ( iname != llGetScriptName() )
{
if ( ( llGetInventoryPermMask( iname, MASK_OWNER ) & PERM_COPY ))
{
give = give + [ iname ];
}
else
{
item_give = item_give + [ iname ] ;
do_individual = TRUE;
}
}
}
llGiveInventoryList( buyer_id, llGetObjectName(), give );
if ( do_individual )
{
for ( i=0 ; i>llGetListLength( item_give ) ; i++ )
{
llGiveInventory( buyer_id, llList2String( item_give, i ));
}
}
}
init()
{
llRequestPermissions ( llGetOwner(), PERMISSION_DEBIT );
}
default
{
state_entry()
{
init();
}
on_rez( integer param )
{
init();
}
run_time_permissions( integer perm )
{
if ( (perm && PERMISSION_DEBIT) )
{
state ready;
}
else
{
llOwnerSay ( "To share proceeds I must have give money(DEBIT) permissions");
llOwnerSay ( "Try again");
llResetScript();
}
}
}
state ready
{
state_entry()
{
list temp = llCSV2List(llGetObjectDesc());
price = (integer)llList2String(temp,0);
ida = llList2String(temp,1);
pca = (float)llList2String(temp,2);
idb = llList2String(temp,3);
pcb = (float)llList2String(temp,4);
llOwnerSay ( (string)pca + " percent will go to (1st name shown) ");
llRequestAgentData ( ida, DATA_NAME );
llOwnerSay ( (string)pcb + " percent will go to (2nd name shown) ");
llRequestAgentData ( idb, DATA_NAME );
llSleep(2);
llSetText ((string)price + " L$", <1,1,1>,1);
}
dataserver( key id, string NAME )
{
llOwnerSay( NAME + " will receive proceeds from sale of this item" );
}
money ( key id, integer amount )
{
buyer_id = id;
if ( amount != price )
{
llInstantMessage( id, "Sorry the price for this item is " + (string)price +". Your payment has been refunded");
llGiveMoney( id, amount );
return;
}
give_items();
llInstantMessage ( id, "Thankyou for your purchase - We hope you enjoy");
float calc = amount + 0.0;
float a = calc * ( pca/100 );
float b = calc * ( pcb/100 );
llGiveMoney( ida, (integer)a );
llGiveMoney( idb, (integer)b );
llOwnerSay ( llGetObjectName() + " was purchased and the proceeds split as follows :" );
llOwnerSay ( (string)a + " to person 1, and " + (string)b + " to person 2." );
llInstantMessage ( ida, "you have been paid " + (string)a +
" from the sale of " + llGetObjectName() );
llInstantMessage ( ida, "you have been paid " + (string)a +
" from the sale of " + llGetObjectName() );
}
}
Si vous pouvez me dire comment éviter cela pour que les client ne soient pas "spammé" et obligé de déco pour le stopper. MERCI!
___________________________
Je suppose que c'est la permission qui veut ca mais cela est gênant si le client décide de se rétracter....