Hey everyone;
I've got this opensource camping script that I want to modify to check for a specific active group. The script works well as it is now, I just want to make sure that only members make use of the camping device. Can someone show me how to modify this script?
// Begin Code //
integer campmoney = 0;
integer campadd = 1;
integer camptime = 60;
string reciever;
string sittext1 = "sit here for free money ,\nL$";
string sittext2 = " every 1 minutes";
string camptext = "Paying L$10/10min. ";
string sittext;
integer currenttime = 0;
//
default
{
state_entry()
{
sittext = sittext1 +(string)campadd+ sittext2 ;
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
llSetText(sittext,<0,1,0>,1);
llSitTarget(<0.4, 0, 0.6>, ZERO_ROTATION);
}
on_rez(integer start_param)
{
llResetScript();
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
if (llAvatarOnSitTarget() != NULL_KEY)
{
reciever = llAvatarOnSitTarget();
llSetText(camptext+(string)campmoney,<0,1,0>,1);
llSetTimerEvent(camptime);
}
else
{
llGiveMoney(reciever,campmoney);
reciever="";
campmoney=0;
llSetText(sittext,<0,1,0>,1);
llSetTimerEvent(100000000);
}
}
}
timer()
{
campmoney = campmoney+campadd;
llSetText(camptext + llKey2Name(reciever) + " has earned $" + (string)campmoney + "L so far." ,<0,1,0>,1);
if (llAvatarOnSitTarget() != NULL_KEY)
{
}
else
{
reciever="";
campmoney=0;
llSetText(sittext,<0,1,0>,1);
}
currenttime++;
llOwnerSay((string)currenttime);
if(currenttime == 10)
{
llUnSit(llAvatarOnSitTarget()); // unsit him
currenttime = 0;
}
}
run_time_permissions(integer perms)
{
if(perms & PERMISSION_DEBIT)
{
llSetText(sittext,<0,1,0>,1);
}
else
{//Permissions was denied.
llSetText("OFFLINE",<1,0,0>,1);
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
}
}
}
//End Code //