Freeze Timer (AFK)
#1

Hi, how can i make a "freeze timer" if you type /back you are unfreezed in 5 seconds?

//------------------------[Back]--------------------------------------------------
if(strcmp(cmdtext, "/back", true) == 0)
{
if(BRB[playerid] == 1 || AFK[playerid] == 1)
{
new str[256];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(str, sizeof(str), "[AFK] %s ist wieder zurьck.", sendername);
SendClientMessageToAll(COLOR_GREEN, str);
TogglePlayerControllable(playerid,true);
SetPlayerVirtualWorld(playerid, 0);
BRB[playerid] = 0;
AFK[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Du bist nicht im AFK-Modus!");
return 1;
}
}

pls help me
Reply
#2

Add this somewhere, bottom of script or something.


Код:
forward AFKtimer();
public AFKtimer()
{
   TogglePlayerControllable(playerid,true);
   return 1;
}
Add this on /back

Код:
SetTimer("AFKtimer",5000,false);
Reply
#3

and why you're using [256] ?
this is the double array of size, try [128]
Reply
#4

Don't even use 256.

Ecko
Reply
#5

THX will test it
Reply
#6

Ok
Reply
#7

C:\Users\Mani\Desktop\new script\RL\pawno\filterscripts\afk.pwn(53) : error 017: undefined symbol "playerid"
Reply
#8

What is on that line?
Reply
#9

TogglePlayerControllable(playerid,true);
Reply
#10

Quote:
Originally Posted by » ded «
Add this somewhere, bottom of script or something.


Код:
forward AFKtimer();
public AFKtimer()
{
  TogglePlayerControllable(playerid,true);
  return 1;
}
Add this on /back

Код:
SetTimer("AFKtimer",5000,false);
Add "playerid" So it would be like this
Код:
forward AFKtimer(playerid);
public AFKtimer(playerid)
{
   TogglePlayerControllable(playerid,true);
   return 1;
}
Код:
SetTimerEx("AFKtimer",5000,false,"i",playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)