zcmd and strcmp - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: zcmd and strcmp (
/showthread.php?tid=226479)
zcmd and strcmp -
xir - 15.02.2011
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?
Re: zcmd and strcmp -
Calgon - 15.02.2011
Paste your code for the OnPlayerCommandReceived callback.
Re: zcmd and strcmp -
Mean - 15.02.2011
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.
Re: zcmd and strcmp -
xir - 15.02.2011
If I change strcmp to zcmd it doesnt work ingame :S
Re: zcmd and strcmp -
Retardedwolf - 15.02.2011
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.
Re: zcmd and strcmp -
Sergei - 15.02.2011
Use strcmp command under OnPlayerCommandPerformed and make sure you return 1
Re: zcmd and strcmp -
admantis - 15.02.2011
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.
Re: zcmd and strcmp -
MrDeath537 - 15.02.2011
Why don't you convert that command to ZCMD?