18.01.2016, 00:26
Try
PHP код:
CMD:afk(playerid,params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(PlayerInfo[playerid][Afk] == 0)
{
PlayerInfo[playerid][Afk] = 1;
SetPlayerHealth(playerid,100000);
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid,green,"AFK ON");
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,265.1273,77.6823,1001.0391);
SetPlayerFacingAngle(playerid,271.3259);
SendClientMessageToAll(yellow,"[INFO]:%s is now away from keyboard, you can't reach him!");
return true;
}
else
{
PlayerInfo[playerid][Afk] = 0;
SetPlayerHealth(playerid,100);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid,red,"AFK OFF");
SendClientMessageToAll(yellow,"[INFO]:%s is not away anymore, now you can reach him!");
return true;
}
}
return SendClientMessage(playerid,red,"ERROR: You must be registered and logged in to use this feature");
}