01.03.2015, 11:43
Hey,
I made an AFK system, and I wanted to block players who are AFK from using ANY commands at all. But I have a problem. I added it so you can't use any commands whilst AFK, and you can still use the command but the message will come up.
For e.g, if I'm AFK and I use /kill, a message will be sent saying "You cannot use commands whilst AFK", but the command still works. I use ZCMD
Here is the code,
Thanks
I made an AFK system, and I wanted to block players who are AFK from using ANY commands at all. But I have a problem. I added it so you can't use any commands whilst AFK, and you can still use the command but the message will come up.
For e.g, if I'm AFK and I use /kill, a message will be sent saying "You cannot use commands whilst AFK", but the command still works. I use ZCMD
Here is the code,
Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success ) { if(!success ) return SendClientMessage( playerid, 0xFF0000FF, "Command not found! Please try again, or use /cmds to view a list of working commands." ); if(afk[playerid] == 1) return Error(playerid, "You cannot use any commands whilst AFK"), 0; return 1; }