ZCMD Command Restriction
#10

Quote:
Originally Posted by YoussefHammad
View Post
here's the whole code
Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success)
	{
	    SendClientMessage(playerid,COL_GREEN,"ERROR: Invalid command! Check /CMDS for the commands list");
	}
	format(szString, sizeof(szString), "[CMD]: %s[%d] Has Used Command: %s", PlayerName(playerid), playerid, cmdtext);
	for (new a = 0; a < MAX_PLAYERS; a++) if (IsPlayerAdmin(a))
 	SendClientMessage(a, 0xF6BB0AA, szString);
	return 1;
}
didnt edit anything , it all works but the problem is that the Invalid Command msg shows up whenever i do any cmd

how can i fix it ? i tried to return 0 but when i did it showed the Invalid command and that white "Unkown Command" thing
Find OnPlayerCommandText
return 1 instead of 0
^^
This disables the default unknown command
and the way new YSI works is you should put your unknown command text under OnPlayerCommandReceived
because OnPlayerCommandPerformed is called after a command finishes not before
Reply


Messages In This Thread
ZCMD Command Restriction - by YoussefHammad - 10.11.2015, 21:48
Re: ZCMD Command Restriction - by Jefff - 10.11.2015, 22:00
Re: ZCMD Command Restriction - by YoussefHammad - 10.11.2015, 22:03
Re: ZCMD Command Restriction - by Jefff - 10.11.2015, 22:07
Re: ZCMD Command Restriction - by YoussefHammad - 10.11.2015, 22:10
Re : ZCMD Command Restriction - by Dutheil - 11.11.2015, 00:54
Re: Re : ZCMD Command Restriction - by YoussefHammad - 11.11.2015, 01:01
Re : ZCMD Command Restriction - by Dutheil - 11.11.2015, 01:04
Re: Re : ZCMD Command Restriction - by YoussefHammad - 11.11.2015, 01:23
Re: Re : ZCMD Command Restriction - by PrO.GameR - 11.11.2015, 07:04

Forum Jump:


Users browsing this thread: 3 Guest(s)