need help 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: need help with sscanf (
/showthread.php?tid=305383)
need help with sscanf -
rati555 - 22.12.2011
pawn Код:
CMD:createcar(playerid, params[])
{
new mid;
new vfile[225];
new color1;
new color2;
new member;
if(sscanf(params, "iiii", mid,color1,color2,member)) return SendClientMessage(playerid, 0xFFFFFF, "/createcar [ModelID][color1][color2]");
else if(mid > 600 || mid < 400) return SendClientMessage(playerid, 0xFFFFFF, "uknown modelid");
else if(color1 > 0 || color1 < 126) return SendClientMessage(playerid, 0xFFFFFF, "uknown col2");
else if(color2 > 0 || color2 < 126) return SendClientMessage(playerid, 0xFFFFFF, "uknown col2");
else if(member > 0 || member < 3) return SendClientMessage(playerid, 0xFFFFFF, "uknown member");
It Sends Me message
please help
//-------------------------------------------------------------------------//
Sorry for my bad english
Re: need help with sscanf -
vassilis - 22.12.2011
/createcar [modelid] [color1] [color2] = 3
sscanf = 4 " i i i i" maybe you are pressing wrong command :S
Re: need help with sscanf -
Vince - 22.12.2011
It's just that all your if statements are wrong. Nothing to do with sscanf. I hope you learned in school what the
greater than and
smaller than symbols are? And I also hope that you know what
return means?
Logic thinking and common sense will solve your problem.