#1

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!
Reply
#2

fixed. (8chars)
Reply
#3

strfind!

pawn Код:
if(strfind(cmdtext, "/login", true) == -1)
{
// /login has not been found in cmdtext[]
}
Reply
#4

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?
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
Well, thanks!

This was really lame...seriously lame...
Thanks, it worked.Also what -1 does?
So use
pawn Код:
.... != -1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)