sscanf bug? - 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 bug? (
/showthread.php?tid=635596)
[SOLVED] -
AfiqIqbal - 10.06.2017
SOLVED.
Re: sscanf bug? -
Toroi - 10.06.2017
PHP код:
if(sscanf(params, "us[128]", VotekickPlayerID, VotekickReason))
{
SendClientMessage(playerid, -1, "[Error:] /votekick <id> <reason>");
}
If you don't tell the script to stop there, it wont, so either the command issued is wrong or bad, the rest of the command will execute.
Use
return in the code above for the rest of the command to stop executing.
Re: sscanf bug? -
AfiqIqbal - 10.06.2017
Quote:
Originally Posted by Toroi
PHP код:
if(sscanf(params, "us[128]", VotekickPlayerID, VotekickReason))
{
SendClientMessage(playerid, -1, "[Error:] /votekick <id> <reason>");
}
If you don't tell the script to stop there, it wont, so either the command issued is wrong or bad, the rest of the command will execute.
Use return in the code above for the rest of the command to stop executing.
|
Thank you for your quick reply, I will try it later
Re: sscanf bug? -
saffierr - 10.06.2017
Hey, just a question, do you really create new variables on the top of your script for each cmd?
If yes, thats not really how you should do it.
Re: sscanf bug? -
AfiqIqbal - 11.06.2017
Quote:
Originally Posted by saffierr
Hey, just a question, do you really create new variables on the top of your script for each cmd?
If yes, thats not really how you should do it.
|
No, I didn't create new variables on top of my script for each cmd I made.
Re: sscanf bug? -
AfiqIqbal - 11.06.2017
I've tried the fix and it worked! Thanks for all who helped me