zcmd preventing command execution
#1

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

OnPlayerCommandText is not compatible with ZCMD from what I heard. idk.

Another way is to edit zcmd.inc or Check during every command
Reply
#3

pawn Код:
OnPlayerCommandPerformed(playerid, cmdtext[], success);
{
if (PlayerInfo[playerid][LoggedIn]==0) return SendClientMessage(playerid,red,"Login first to use commands.");
}
Reply
#4

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

It works thank you
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)