Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problem mit Timer-Event

Tomfox Wiranata
Registered User
Join date: 20 Dec 2006
Posts: 80
02-09-2007 08:57
Hi Leute!

Ich habe das Problem, dass Spieler, sobald sie mein Terminal bezahlt haben, ausgeloggt werden und ihr Geld wiederbekommen. Eigentlich habe ich den Timer so eingestellt, dass das erst nach 180s passiert.

CODE

touched(key toucher)
{
if (currentUser == toucher || currentUser == NULL_KEY)
{
//llSetTimerEvent(0);
llInstantMessage(currentUser,"You are the current user of this terminal");

name = llDetectedName(0);
integer ch = ChannelFromName(name);

llListen(ch,"",currentUser,"");
}

else
{
llInstantMessage(currentUser,"This system is already in use. ");
}

}





default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
state idle;
}
}



state idle
{
state_entry()
{
resetParameters();
llSetText("",<1,0,0>,1);
llSetPayPrice(PAY_HIDE,[15,30,45,60]);
}


money(key giver, integer amount)
{
name = llDetectedName(0);
integer ch = ChannelFromName(name);

currentUser=giver;
refund = amount;
howlong = ((amount / 15) * 7);
draws = amount/15;

state payed;
}

}





state payed
{

state_entry()
{
integer ch = ChannelFromName(name);
llListen(ch,"",currentUser,"");
llSetTimerEvent(180);
touched(currentUser);

}

listen()
{
...
}

timer()
{

llInstantMessage(currentUser,"Time is up. You were logged off");
llGiveMoney(currentUser, refund);
currentUser = NULL_KEY;

state idle;
}


Hoffe ihr könnt ihr helfen :)

danke
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
02-09-2007 10:14
touch_start(integer n) {
if (currentUser == llDetectedKey(0)|| currentUser == NULL_KEY) {