SCCANF return invalid_player_id every time... -
Snowman12 - 02.10.2011
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;
}
Re: SCCANF return invalid_player_id every time... -
Pharrel - 02.10.2011
actualize your include/plugin
Respuesta: SCCANF return invalid_player_id every time... -
OPremium - 02.10.2011
Try this:
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(!IsPlayerConnected(Healing)) 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;
}
And also try updating sscanf if you have the version 0.3c-R5 of the SA:MP server
Re: SCCANF return invalid_player_id every time... -
DRIFT_HUNTER - 02.10.2011
Just update plugin
Re: Respuesta: SCCANF return invalid_player_id every time... -
Snowman12 - 02.10.2011
Quote:
Originally Posted by Pharrel
actualize your include/plugin
|
I though it was my plugin Yet the one I downloaded and keep downloading 0.3c rc5 sscanf 2 doesnt work.
Quote:
Originally Posted by OPremium
Try this:
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(!IsPlayerConnected(Healing)) 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; }
And also try updating sscanf if you have the version 0.3c-R5 of the SA:MP server
|
The code above wont change anything
I use this SSCANF
http://forum.sa-mp.com/showthread.ph...ghlight=SSCANF
Yet no hope INVALID_PLAYER_ID is still returned