SA-MP Forums Archive
[Help] ZCMD before log-in - 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: [Help] ZCMD before log-in (/showthread.php?tid=235527)



[Help] ZCMD before log-in - BloodMaster - 05.03.2011

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.


Re: [Help] ZCMD before log-in - Mean - 05.03.2011

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 .


Re: [Help] ZCMD before log-in - BloodMaster - 06.03.2011

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?


Re: [Help] ZCMD before log-in - Calgon - 06.03.2011

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.


Re: [Help] ZCMD before log-in - [WF]Demon - 06.03.2011

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.


Re: [Help] ZCMD before log-in - BloodMaster - 06.03.2011

Tnx guys, working. Respect

Lock