|
Here a script that will alk a question
after the camper stands up, the camper must answer
otherwise no payout.
//JUST AN OTHER CAMPSCRIPT, MOD BY FLATER BAXTER///
//////////////////////
////CAMP SETTINGS/////
//////////////////////
integer mins = 1; //MINS
integer amount = 2; // LINDENS
//////////////////////
//////////////////////
list list_check = ["APPLE","BIRD","CAKE","EAL","FRUIT","GOTH","HOT","IRIS","NUMBER"];
integer count;
integer minutes;
integer cash = 0;
integer Max_Cash = 0;
integer counter = FALSE;
key user;
key payee;
string sitting ;
string dsitting ;
integer show = TRUE;
integer clen;
integer cnr;
string qw;
integer chk;
integer chan5 ;
vector color = <1,0,0>;
integer plus = 0;
integer chan ;
list parceld;
list parcelo= [PARCEL_DETAILS_NAME, PARCEL_DETAILS_DESC];
string parceln;
vector regionbase;
RefreshText()
{
llSetText("Sit here for
"+(string) amount+" L$s Per. " +(string) mins+" Mins
.
.
.
.
.
.",color,1);
}
RefreshText1()
{
llSetText("
"+sitting+"
Has made: "+(string) cash+" L$s
by sitting for: "+(string) count+" mins
"+(string) amount+" L$s Per. " +(string) mins+" Mins
.
.
.
.
.
.",color,1);
}
integer charge=0;
integer Ready=FALSE;
default
{
state_entry()
{
llSetText("INACTIVE",<1,0,0>,1);
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_DEBIT)
{
state one;
}
else
{
llOwnerSay("You need to give premisions");
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
}
}
}
state one
{
state_entry()
{
RefreshText();
parceld= llGetParcelDetails( regionbase, parcelo);
parceln=llStringTrim( llList2String(parceld ,0),STRING_TRIM);
}
on_rez(integer tot_num)
{
llResetScript();
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
user = llAvatarOnSitTarget();
llMessageLinked(LINK_SET,0,"on",NULL_KEY);
if (user != NULL_KEY) {
counter = TRUE;
color = <1,0,0>;
sitting = llKey2Name(user);
llSetTimerEvent(60);
RefreshText1();
payee = user;
}
else
{
counter = FALSE;
sitting = dsitting;
if (cash>0){
state pay;
}
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;
llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
}
}
}
timer()
{
if(counter == TRUE)
{
count += 1;
plus += 1;
if(plus == mins)
{
cash += amount;
plus = 0;
}
RefreshText1();
}
}
}
state pay
{
state_entry()
{
clen =llGetListLength(list_check);
cnr = llFloor(llFrand(clen));
qw = llList2String(list_check,cnr);
llSetText("In Use, \n please wait 30 sec.",<1,0,0>,1);
llSetTimerEvent(30);
chan5 = llFloor(llFrand(99999.1000));
llListen(chan5,"",payee,"");
llDialog(payee,"\n SELECT THIS WORD IN THE MENU BUTTONS: \n \n"+qw + "\n \n",list_check,chan5);
}
listen(integer channel, string name, key id, string message)
{
if(message == qw)
{
llGiveMoney(payee,cash);
Max_Cash += cash;
llSay(0,llKey2Name(payee)+" got " +(string) cash+ "L$s, Just for lounging here at "+ parceln);
/////////////////
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;
llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
chk = 0;
state one;
}
else {
llSay(0,"Wrong answer, please try aggain");
chk += 1;
if(chk <= 1) llDialog(payee,"\n SELECT THIS WORD IN THE MENU BUTTONS: \n \n"+qw + "\n \n",list_check,chan5);
if (chk == 2)
{
llSay(0,"Wrong Again, srry cant payout");
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;
llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
chk = 0;
state one;
}
}}
timer()
{
payee = NULL_KEY;
cash = 0;
minutes = 0;
count = 0;
color = <1,0,0>;
llSetTimerEvent(0);
show = TRUE;
llMessageLinked(LINK_SET,0,"off",NULL_KEY);
RefreshText();
state one;
}
}
|