08.04.2012, 21:50
dont use strcmp its outdated! and try this and all you do is define a timer for afk members
if failing that then try putting this in with a afk system
Код:
new AFK[MAX_PLAYERS]; CMD:afk(playerid, params[]) { new string[200]; if(AFK[playerid] == 0) { SetPlayerHealth(playerid, 999999); format(string, sizeof(string), " **{00CCFF}[ AFK ] {2641FE} %s {FFFFFF}is now AFK Don't attack him!", PlayerName(playerid)); SendClientMessageToAll(COLOR_MODRA, string); TogglePlayerControllable(playerid, false); SendClientMessage(playerid, COLOR_WHITE,"You are now AFK"); AFK[playerid] = 1; } return 1; } CMD:back(playerid, params[]) { new string[200]; if(AFK[playerid] == 1) { SetPlayerHealth(playerid, 60); format(string, sizeof(string), " **{00CCFF}[ AFK ] {2641FE} %s {FFFFFF}is now Back!", PlayerName(playerid)); SendClientMessageToAll(COLOR_MODRA, string); TogglePlayerControllable(playerid, true); SendClientMessage(playerid, COLOR_WHITE,"Welcome Back! "); AFK[playerid] = 0; } return 1; }
Код:
new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "[AFK]%s", name); SetPlayerName(playerid, string);