Commands are fucked
#1

Why I can't use any command?
I use zcmd but every command is not working.
Also when I type /adsfasdf it does not say "Unknown Command"

Please help! It's urgent!
Reply
#2

do you have 'return' inside cmd ?
Reply
#3

Yes, even the normal

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // all
        return 1;
    }
    return 0;
}
is not working for me.
Reply
#4

Show the code please...
Reply
#5

Which code? I deleted the commands, nothing worked.
But my code is really new so it has almost no stuff which means if I do /asdfasd it should say: "Unknown Command".
But it doesn't
Reply
#6

Quote:
Originally Posted by arjanforgames
Посмотреть сообщение
I use zcmd
Yet you show strcmp commands? Do you even know how ZCMD commands are to be implemented?
Reply
#7

This doesnt work also:

pawn Код:
CMD:test(playerid, params[])
{
    SendClientMessage(playerid, -1, "test");
    return 1;
}
Reply
#8

The thing is, you don't put the zcmds under OnPlayerCommandText.
Example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // all
        return 1;
    }
    return 0;
}
You can't use the following under OnPlayerCommandText
pawn Код:
CMD:test(playerid, params[])
{
    SendClientMessage(playerid, -1, "test");
    return 1;
}
Example of what NOT to do:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    CMD:test(playerid, params[])
    {
    SendClientMessage(playerid, -1, "test");
    return 1;
    }
return 1;
}
If you put the CMD:test under OnPlayerCommandText, it doesn't work, because you can only put strcmp commands under OnPlayerCommandText.
zcmd can be put anywhere on the script, just do it like I showed you.
Hope I helped!
Reply
#9

I had it at the bottom of my script

I need this fixed!!
Reply
#10

You can't use strcmp and zcmd at the same time, you must remove the OnPlayerCommandText callback, and go along with your ZCMD commands.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)