SA-MP Forums Archive
Tempban command is not working properly. - 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: Tempban command is not working properly. (/showthread.php?tid=566381)



Tempban command is not working properly. - Sc0pion - 05.03.2015

Fixed!


Re : Tempban command is not working properly. - Golimad - 05.03.2015

Sscanf is your friend you know ?
new reason[64], targetid, days;
if(!sscanf(params,"uds",targetid,days,reason))

And you got the player, time, reason in one line!


Re: Tempban command is not working properly. - CalvinC - 05.03.2015

String size of 300? And using strtok?
I don't think you need a size of 300, and as Golimad told, you should also try using newer metods, like sscanf.
Although @Golimad, sscanf requires a string size.
Quote:

"uds[64]"




Re : Tempban command is not working properly. - Golimad - 05.03.2015

"uds[64]" is required when params size is defined I think.
I've tried "uds" and it works fine for me
but in Commands processors its this way : Cmd:command(playerid, params[])


Re: Re : Tempban command is not working properly. - CalvinC - 05.03.2015

When not defining a size for a sscanf string, i get printed an error for not doing so in the server console.
But i haven't used strcmp to use commands, so that might be different.


Re : Re: Re : Tempban command is not working properly. - Golimad - 05.03.2015

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
When not defining a size for a sscanf string, i get printed an error for not doing so in the server console.
But i haven't used strcmp to use commands, so that might be different.
you are right, Just use s[size] its in the sscanf wiki.


Re: Tempban command is not working properly. - Sc0pion - 06.03.2015

Fixed!


Re: Tempban command is not working properly. - CalvinC - 06.03.2015

Try using sscanf as we explained, it automatically detects if you don't write anything, aswell as assigning the parameters.


Re : Tempban command is not working properly. - Golimad - 06.03.2015

You fix it by downloading Sscanf and using it.


Re: Tempban command is not working properly. - Sc0pion - 06.03.2015

Fixed!