29.08.2009, 15:11
Hi guys, i was recommended to try out zcmd, as i'm thinking of converting my commands which use the old and slow version (strcmp).
Only thing is, i don't know fully how to use it, and need some guidance. So far I've added the Include:
And I've added the function for the command as was given in the example on the first post.
Am i correct in saying that the above should not be in the OnPlayerCommandText callback?
Right, now that I have that, how do i make a command with multiple parameters for instance, can someone give me an example of lets say, /givemoney <playerid> <amount> command. I haven't worked with dcmd either which may have helped, and also do i need Sscanf?
Thanks ur help is much appreciated.
Only thing is, i don't know fully how to use it, and need some guidance. So far I've added the Include:
pawn Code:
#include <zcmd>
pawn Code:
zcmd(mycommand, playerid, params[])
{
// Do something
return 1;
}
Right, now that I have that, how do i make a command with multiple parameters for instance, can someone give me an example of lets say, /givemoney <playerid> <amount> command. I haven't worked with dcmd either which may have helped, and also do i need Sscanf?
Thanks ur help is much appreciated.
