In scripting terms, why do this:
//-----------------------------
integer price = 100;
default {
state_entry() {
llSetPayPrice(PAY_HIDE,[price,PAY_HIDE,PAY_HIDE,PAY_HIDE]);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer perm) {
if(perm & PERMISSION_DEBIT) state active;
}
}
state active {
money(key customer, integer amt_paid) {
if(amt_paid != price) {
llGiveMoney(customer,amt_paid);
llInstantMessage(customer,"You paid the wrong amount."
;}else{
llGiveInventory(customer,"stuff"
;llInstantMessage(customer,"Thanks for your purchase!"
;}
}
}
//-----------------------------------
....instead of simply this.....
//~~~~~~~~~~~~~~~~~~~~~
integer price = 100;
default {
state_entry() {
llSetPayPrice(PAY_HIDE,[price,PAY_HIDE,PAY_HIDE,PAY_HIDE]);
}
money(key customer, integer amt_paid) {
if(amt_paid != price) {
llInstantMessage(customer,"Take your hacked client elsewhere. And thanks for the donation. Kthxbi."
;llTeleportAgentHome(customer);
}else{
llGiveInventory(customer,"stuff"
;llInstantMessage(customer,"Thanks for your purchase!"
;}
}
}
//~~~~~~~~~~~~~~~~~~~
Thoughts?
In fact I do not check the amount. If some one exploits me I will not see it until I look in the transactions history.
