afk command help
#1

i trying to do afk command and i want to check if you already freeze or not

Код:
 if (TogglePlayerControllable(playerid,0)) return SendClientMessage(playerid,0xFF000FFF,"You are already freezed");
it's don't work, it's type "You are already freezed" even if you not and it's make you freeze anyway
Reply
#2

Make a variable.
Reply
#3

dude ... TogglePlayerControllable(playerid,0) will always return 1 that is true and so you will always get that message .......... You have to create a variable at the stating like
Код:
new bool:IsPlayerFreezed[MAX_PLAYERS]=false;
And the place where you have your afk code .... add something like this
Код:
IsPlayerFreezed[playerid]=true;
now you can run it like this
Код:
if (IsPlayerFreezed[playerid])) return SendClientMessage(playerid,0xFF000FFF,"You are already freezed");
// Below this goes your BACK code //////
// add this one in BACK code too //
IsPlayerFreezed[playerid]=false;
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,0xFF000FFF,"You have been un-freezed");
return 1;
Thank You
Abhinav

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)