13.05.2012, 10:34
Heey all,
I am helping a friend with a giveallweapons command and he wants to have his command with strcmp.
I never used strcmp because i am using dcmd so i used the dance code for the params.
But why it gives the message everytime when i fill in the right code :/giveallweapons 2 it says the error message^
I didnt show the whole code because its only about that message showing when you fill right id.
I am helping a friend with a giveallweapons command and he wants to have his command with strcmp.
I never used strcmp because i am using dcmd so i used the dance code for the params.
Код:
new cmd[256];
new idx;
new weaponid;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/giveallweapons", true) == 0)
{
cmd = strtok(cmdtext, idx);
tmp = strtok(cmdtext, idx);
weaponid = strval(tmp);
if(weaponid < 1 || weaponid > 46) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /giveallweapons [weaponid]");
return 1;
}
I didnt show the whole code because its only about that message showing when you fill right id.

