Posts: 87
Threads: 8
Joined: Apr 2010
Hi!
I need help about ZCMD.
I made a log/reg system and I using zcmd. Now, how I can stop any command if player is not loged?
Logged player is defined like this:
Код:
Logged[MAX_PLAYERS];
Sry for bad english.
Posts: 87
Threads: 8
Joined: Apr 2010
I know that, but with this I need to put it in all commands...
I tryed this but dont work:
Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(Logged[playerid] == 0) return SM(playerid,"Not Logged");
return 1;
}
SM is this:
Код:
#define SM(%0,%2) SendClientMessage(%0,0xFFFFFFFF,%2)
With this code, If I type nonexistent command will tell: "Not Logged", but if I type existing command, will tell "Not Logged" too but the command will be executed...
Any help?
Posts: 6,129
Threads: 36
Joined: Jan 2009
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[]) {
if(Logged[playerid] == 0) {
SM(playerid,"Not Logged");
return 0;
}
return 1;
}
You need to return 0, I don't recall what SendClientMessage returns.
Posts: 87
Threads: 8
Joined: Apr 2010
Tnx guys, working. Respect
Lock