25.08.2014, 12:18
This is how it looks but when i got in game it says that the player isn't connected. Somehow it stops there. Could someone help me out?
This also happened with my other commands.
Thank you.
This also happened with my other commands.
Thank you.
Код:
CMD:sethealth(playerid, params[]) { new id; new hp; if(PlayerInfo[playerid][pAdmin] >= 6) { if(!sscanf(params, "ui", id, hp)) { if(!IsPlayerConnected(id)) { SendClientMessage(playerid, -1, "SERVER: The player isn't connected."); return 1; } new string[64]; new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "SERVER: Administrator %s has set your health to %d", name, hp); SendClientMessage(id, BLUE, string); format(string, sizeof(string), "SERVER: You have Set %s health to %d.", PlayerName, hp); SendClientMessage(playerid, BLUE, string); SetPlayerHealth(id, hp); return 1; } else return SendClientMessage(playerid, -1, "SERVER: /sethealth [PlayerId/PartOfName] [Hp]"); } else { SendClientMessage(playerid, RED, "You cannot use this command."); return 1; } }