Problem with sscanf - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with sscanf (
/showthread.php?tid=290300)
Problem with sscanf -
[IL]HeHu - 15.10.2011
This is just one of my codes:
PHP код:
CMD:setskin(playerid, params[])
{
if(!PlayerInfo[playerid][pAdmin])
return 0;
new
id,
skin,
string[72]
;
printf("b");
if(sscanf(params,"ui",id,skin))
return SendClientMessage(playerid,C_NICE,"[Usage] {FFFFFF}/setskin [playerid/PON] [skin]");
printf("%i | %i",id,skin);
if(!IsPlayerConnected(id))
{
printf("c");
return 0;
}
printf("a");
SetPlayerSkin(id, skin);
PlayerInfo[id][pSkin] = skin;
printf("d");
SendFormat(id,C_GRAD2,"%s has set your skin to %i",GetName(playerid),skin);
SendFormat(playerid,C_GRAD2,"You have set %s skin to %i",GetName(id),skin);
format(string,sizeof(string),"AdmWrn: {DABB3E}%s has set %s's skin to %i",GetName(playerid),GetName(id),skin);
AMsg(string,C_RED);
printf("e");
return 1;
}
All the letters are for debugging.
Since I moved my server to 0.3d the "u" function that detects both names and numbers of users stopped working ALL over my mode. Does anyone know how to fix it?
Re: Problem with sscanf -
SmiT - 15.10.2011
Sscanf don't work on 0.3d version.
Re: Problem with sscanf -
[MWR]Blood - 15.10.2011
The 'u' is bugged in 0.3d. Use the normal int instead:
pawn Код:
if(sscanf(params,"ii",id,skin))
Re: Problem with sscanf -
GrimR - 15.10.2011
Doesn't "u" check if they are online and if not return INVALID_PLAYER_ID though?
This means you now have to check exclusively?