02.10.2011, 22:05
Hey, No matter what command I make SSCANF returns invalid player id
pawn Код:
CMD:heal(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not a Admin");
{
new Healing, string[52];
if(sscanf(params, "u", Healing)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Usage: /heal [id]");
else if(Healing == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: User is not connected");
SetPlayerHealth(Healing, 100);
new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(Healing, tName, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has healed you!", pName);
SendClientMessage(Healing, COLOR_GREEN, string);
format(string, sizeof(string), "You have healed %s", tName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "[Admin %s] Has Healed %s", pName, tName);
SendMessageToAdmins(COLOR_GREEN, string);
}
return 1;
}