zcmd and strcmp
#1

Hi

I have a problem, ive got many zcmd comamnds and 1 strcmp cmd..

ive put the strcmp under public OnPlayerCommandReceived(playerid, cmdtext[])
and everything compiles fine but when I do the command ingame, the command works but it always say "SERVER: Unknown command." what to do?
Reply
#2

Paste your code for the OnPlayerCommandReceived callback.
Reply
#3

You cannot use ZCMD + STRCMP together, you also must delete the OnPlayerCommandText, and put the ZCMD cmds anywhere in the script. Convert the STRCMP cmd to ZCMD. Also, make sure ZCMD cmds are not under OnPlayerCommandText or any other callback.
Reply
#4

If I change strcmp to zcmd it doesnt work ingame :S
Reply
#5

Quote:
Originally Posted by Mean
Посмотреть сообщение
You cannot use ZCMD + STRCMP together.
People often mix that up. ^

pawn Код:
COMMAND:getname( playerid, params [ ] )
{
    if ( !strcmp( "HAI", params ) ) Ban( playerid );
    return 1;
}
what will be wrong with that? Nothing. strcmp is a function, afaik zcmd only collides with oPCT.

Convert all of your commands to zcmd and remove oPCT callback.
Reply
#6

Use strcmp command under OnPlayerCommandPerformed and make sure you return 1
Reply
#7

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
People often mix that up. ^

pawn Код:
COMMAND:getname( playerid, params [ ] )
{
    if ( !strcmp( "HAI", params ) ) Ban( playerid );
    return 1;
}
what will be wrong with that? Nothing. strcmp is a function, afaik zcmd only collides with oPCT.

Convert all of your commands to zcmd and remove oPCT callback.
I believe he meant like if (strcmp(cmdtext, "/lolgay",true)==0) use it to process commands, not to compare two strings.
Reply
#8

Why don't you convert that command to ZCMD?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)