ZCMD - 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 (
/showthread.php?tid=177553)
ZCMD -
Zh3r0 - 18.09.2010
Well i made the system for admins to read the commands, now how can i skip commands /register /login and all that?
I tried with strcmp, didn't work if there was a param, tried with cmd_register(playerid, cmdtext) didn't work, it would have executed the command....
here is the code i have on OnPlayerCommandPerformed(playerid, cmdtext[], success)
pawn Код:
if( success == 1 && S_DATA[ S_ReadCMDS ] == 1/*strcmp(cmdtext, "/register", false )*/)
FormMessageForAdmins( COLOR_GREY, " %s used command %s ", PlayerName2( playerid ), cmdtext);
Is there a way ? Please leave a reply. Thanks!
Re: ZCMD -
Retardedwolf - 18.09.2010
fixed. (8chars)
Re: ZCMD -
woot - 18.09.2010
strfind!
pawn Код:
if(strfind(cmdtext, "/login", true) == -1)
{
// /login has not been found in cmdtext[]
}
Re: ZCMD -
Zh3r0 - 18.09.2010
Quote:
Originally Posted by exora
strfind!
pawn Код:
if(strfind(cmdtext, "/login", true) == -1) { // /login has not been found in cmdtext[] }
|
Well, thanks!
This was really lame...seriously lame...
Thanks, it worked.Also what -1 does?
Re: ZCMD -
woot - 18.09.2010
https://sampwiki.blast.hk/wiki/Strfind
Returns The number of characters before the sub string (the sub string's start position) or -1 if it's not found.
Re: ZCMD -
wups - 18.09.2010
Quote:
Originally Posted by Zh3r0
Well, thanks!
This was really lame...seriously lame...
Thanks, it worked.Also what -1 does?
|
So use