zcmd preventing command execution - 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 preventing command execution (
/showthread.php?tid=171858)
zcmd preventing command execution -
grabek4444 - 28.08.2010
I'm learning zcmd and i'm wondering how to disable commands usage when player is not logged in. Do i have to add to every command
pawn Код:
if (PlayerInfo[playerid][LoggedIn]==0) return SendClientMessage(playerid,red,"Login first to use commands.");
or there is a fastest way? Because adding this line to every command will take some time. Also due to zcmd is function based OnPlayerCommandText don't affect it. So this what i tried first
pawn Код:
OnPlayerCommandText(playerid,cmdtext)
{
if (PlayerInfo[playerid][LoggedIn]==0) return SendClientMessage(playerid,red,"Login first to use commands.");
}
doesn't work. Thanks in advance for help.
Re: zcmd preventing command execution -
Retardedwolf - 28.08.2010
OnPlayerCommandText is not compatible with ZCMD from what I heard. idk.
Another way is to edit zcmd.inc or Check during every command
Re: zcmd preventing command execution -
DRIFT_HUNTER - 28.08.2010
pawn Код:
OnPlayerCommandPerformed(playerid, cmdtext[], success);
{
if (PlayerInfo[playerid][LoggedIn]==0) return SendClientMessage(playerid,red,"Login first to use commands.");
}
Re: zcmd preventing command execution -
Calgon - 28.08.2010
Quote:
Originally Posted by DRIFT_HUNTER
pawn Код:
OnPlayerCommandPerformed(playerid, cmdtext[], success); { if (PlayerInfo[playerid][LoggedIn]==0) return SendClientMessage(playerid,red,"Login first to use commands."); }
|
Use 'executed', instead of 'performed' - as it would have had the opportunity to execute and that message would send afterwards.
Re: zcmd preventing command execution -
grabek4444 - 28.08.2010
It works thank you
Re: zcmd preventing command execution -
DRIFT_HUNTER - 28.08.2010
Quote:
Originally Posted by Calgon
Use 'executed', instead of 'performed' - as it would have had the opportunity to execute and that message would send afterwards.
|
LOL i failed thx