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: Sscanf (
/showthread.php?tid=321355)
Sscanf -
lordturhan - 26.02.2012
So there is a strange bug in my server and i think its because of sscanf.
Here is the bug admin commands dont work ids bigger then 7.I want to learn if my parameters are correct.
pawn Код:
else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, RED, "Usage: /warn [id/name][reason]");
Please this is causing major problems in server.
Re: Sscanf -
[XST]O_x - 26.02.2012
s parameter should contain the string size, for example:
pawn Код:
new reason[32];
else if(sscanf(params, "us[32]", id, reason)) SendClientMessage(playerid, RED, "Usage: /warn [id/name] [reason]");
Re: Sscanf -
lordturhan - 26.02.2012
You sure it will fix it?
Re: Sscanf -
[XST]O_x - 26.02.2012
Quote:
Originally Posted by lordturhan
You sure it will fix it?
|
I don't see any other flaw at that line you gave me.
The problem might be in another line.
I just generally said that the 's' parameter should contain the string size.
Re: Sscanf -
Twisted_Insane - 26.02.2012
32 may be a little short, this is from the warn-command I am using at the moment:
pawn Код:
new Target, Reason[ 64 ], sz_msg[ 128 ];
if( sscanf( params, "rs[64]", Target, Reason ) ) return SendClientMessage( playerid, COLOR_LIGHTBLUE, "USAGE: /warn [playerid] [reason]" );
Hope I could help!
Re: Sscanf -
Babul - 26.02.2012
iam sure you are not using th latst update (7). grab the download, and recompile ALL scripts running with the new include.