22.10.2016, 21:06
Quote:
hello, below i have added you 60 seconds for a player needs to wait to go afk again.
Код:
CMD:afk(playerid,params[]) { new afkcount; if(GetTickCount() - afkcount < (60000)) return SendClientMessage(playerid, -1, "You need to wait 60 seconds before using this command again"); if( pInfo[playerid][Spawned] != 1) { ShowMessage(playerid, red, 9); return 1; } if(InEvent[playerid] == 1) { ShowMessage(playerid, red, 11); } if(Afk[playerid] == 1) { SendClientMessage(playerid,red,"You are already /afk. Use the /back command to return to playing the game." ); } else { Afk[playerid] = 1; afkcount = GetTickCount(); GetPlayerHealth(playerid, afkH[playerid]); TogglePlayerControllable(playerid,0); GetPlayerArmour(playerid, afkA[playerid]); SetPlayerHealth(playerid,300000); SetPlayerArmour(playerid,100000); GetPlayerName(playerid, afkname, sizeof(afkname)); format(afkstring,sizeof(afkstring),"[AFK]%s",afkname); SetPlayerName(playerid, afkstring); SendClientMessage(playerid,red,"Your Status is now set to AFK. (You have 5mins or get kick)"); } return 1; } |