Back command help
#9

Just let me know, if the command satisfies what you were trying to do.

pawn Код:
CMD:afk(playerid, params)
{
if(IsPlayerAfk[playerid] == true) return SendClientMessage(playerid, -1, "You are already AFK.");
if(IsPlayerAfk[playerid] == false)  TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~g~AFK",5000,3);
return 1;
}
CMD:back(playerid,params[])
{
 if(IsPlayerAfk[playerid] == false) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]{ffffff}:You are not AFK");
 if(IsPlayerAfk[playerid] == true) TogglePlayerControllable(playerid,1);
 IsPlayerAfk[playerid] = false;
 return 1;

public OnPlayerDisconnect(playerid)
{
   IsPlayerAfk[playerid] = false;
   return 1;
}
public OnPlayerConnect(playerid)
{
  IsPlayerAfk[playerid] = false;
  return;
}
this is the straight output

EDIT: also a quote from below
Quote:

Make sure to set IsPlayerAfk[playerid] to 0 under OnPlayerDisconnect or OnPlayerConnect, or it will bug.

Reply


Messages In This Thread
Back command help - by YanLanger - 11.10.2014, 05:45
Re: Back command help - by GwENiko - 11.10.2014, 05:56
Re: Back command help - by YanLanger - 11.10.2014, 05:57
Re: Back command help - by Shaktimaan - 11.10.2014, 05:57
Re: Back command help - by Stinged - 11.10.2014, 05:59
Re: Back command help - by GwENiko - 11.10.2014, 06:00
Re: Back command help - by YanLanger - 11.10.2014, 06:00
Re: Back command help - by Shaktimaan - 11.10.2014, 06:00
Re: Back command help - by GwENiko - 11.10.2014, 06:02
Re: Back command help - by Stinged - 11.10.2014, 06:03

Forum Jump:


Users browsing this thread: 1 Guest(s)