[Help] ZCMD before log-in
#1

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

pawn Код:
CMD:somecommand( playerid, params[ ] )
{
    if( Logged[ playerid ] == 0 ) return SendClientMessage( playerid, 0xAAAAAA, "You must be logged in to use commands" );
    // And your command...
}
Hope I've helped .
Reply
#3

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

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

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(Logged[playerid] == 0)
    {
        SM(playerid,"Not Logged");
        return 0;
    }
    return 1;
}
Wild guess.

EDIT
Too late, Why is there no alert for when people posted before you like before? seriously.
Reply
#6

Tnx guys, working. Respect

Lock
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)