15.06.2012, 16:49
Please help me .. i got this
need fixed this ... if i type /back and /afklist its will give .: ERROR: Your status is already AFK/BRB :.
hope can help me
need fixed this ... if i type /back and /afklist its will give .: ERROR: Your status is already AFK/BRB :.
Код HTML:
if (strcmp("/afk", cmdtext, true, 10) == 0){ } new string[256]; if (PlayerInfo[playerid][AFKstatus] == 1) { SendClientMessage(playerid, COLOR_RED, ".: ERROR: Your status is already AFK/BRB :."); return 1; } else if (PlayerInfo[playerid][AFKstatus] == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), ".: ( %s ) is away from keyboard :.", pname,playerid); SendClientMessageToAll(COLOR_YELLOW, string); TogglePlayerControllable(playerid,0); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) + 50); PlayerInfo[playerid][AFKstatus] = 1; return 1; } if (strcmp("/brb", cmdtext, true, 10) == 0){ } if (PlayerInfo[playerid][AFKstatus] == 1) { SendClientMessage(playerid, COLOR_RED, "ERROR: You are Aready Afk/And or Brb"); return 1; } else if (PlayerInfo[playerid][AFKstatus] == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), ".: ( %s ) Will Be Right Back (BRB) :.", pname,playerid); SendClientMessageToAll(COLOR_GREEN, string); TogglePlayerControllable(playerid,0); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) + 50); PlayerInfo[playerid][AFKstatus] = 1; return 1; } if (strcmp("/back", cmdtext, true, 10) == 0){ } if (PlayerInfo[playerid][AFKstatus] == 0) { SendClientMessage(playerid, COLOR_RED, "ERROR: You are Aready Back!"); return 1; } else if (PlayerInfo[playerid][AFKstatus] == 1) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), ".:( %s ) has Came Back:.", pname,playerid); SendClientMessageToAll(COLOR_GREEN, string); TogglePlayerControllable(playerid,1); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) - 50); PlayerInfo[playerid][AFKstatus] = 0; return 1; } if (strcmp("/afklist", cmdtext, true, 10) == 0){ } new count = 0; new name[MAX_PLAYER_NAME]; SendClientMessage(playerid, COLOR_LIGHTBLUE, "The Afk List:"); for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(PlayerInfo[i][AFKstatus] == 1) { GetPlayerName(i, name, sizeof(name)); format(string, 256, ".: Away From KeyBoard %s :. ", name,i ); SendClientMessage(playerid, COLOR_YELLOW, string); count++; } } } if (count == 0) { SendClientMessage(playerid, COLOR_RED, ".: No one Is Afk :."); return 1; }