15.08.2009, 15:50
I've searched on the wiki and i didnt find it as useful as i thought it should be.
For example. I had to use "i" instead of "u" for specifying a players id. If i used "u" it would perform the command on me and not the player specified.
This happened when i copied the example command exactly as shown...
Next thing, i want to use an optional integer param, but i haven't found anywhere explaining how.
With strtok its easy, but i dont know where i can find info on it with sscanf.
For example...
i want to make a command to set a players car colour... "/pcarcolor"
If i use /pcarcolor 1 3 (black ,red) it will turn a car or bike black and red provided its able to use two colours.
if i use /pcarcolor 3 (red) it will change the car or bike to red only. Meaning that the second colour wasnt specified, so it automatically becomes the first specified colour.
Or to use a command to display information about a player, "/pkills [playerid]" now this should display their kills. But maybe i want to reset or edit them and use /pkills [playerid] [amount]
how can i do this with sscanf?
For example. I had to use "i" instead of "u" for specifying a players id. If i used "u" it would perform the command on me and not the player specified.
This happened when i copied the example command exactly as shown...
Next thing, i want to use an optional integer param, but i haven't found anywhere explaining how.
With strtok its easy, but i dont know where i can find info on it with sscanf.
For example...
i want to make a command to set a players car colour... "/pcarcolor"
If i use /pcarcolor 1 3 (black ,red) it will turn a car or bike black and red provided its able to use two colours.
if i use /pcarcolor 3 (red) it will change the car or bike to red only. Meaning that the second colour wasnt specified, so it automatically becomes the first specified colour.
Or to use a command to display information about a player, "/pkills [playerid]" now this should display their kills. But maybe i want to reset or edit them and use /pkills [playerid] [amount]
how can i do this with sscanf?