Posts: 1,266
Threads: 6
Joined: Oct 2014
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
{
SendClientMessage(playerid,COL_GREEN,"ERROR: Invalid command! Check /CMDS for the commands list");
}
return 1;
}
Posts: 1,266
Threads: 6
Joined: Oct 2014
Quote:
Originally Posted by PrO.GameR
Changing ! to ==0 doesn't fix a fucking code god damn it, stop being a kosmaghz
You should use this callback for invalid command since latest YSI update
PHP код:
public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
if (success != COMMAND_OK)
{
return SendClientMessage(playerid,COL_GREEN,"ERROR: Invalid command! Check /CMDS for the commands list");
}
return 1;
}
|
stop swearing nab just wait for he's own reply to see if it does not work
Posts: 2,593
Threads: 34
Joined: Dec 2007
Can you show a valid command from your gamemode?
Posts: 2,593
Threads: 34
Joined: Dec 2007
Thats the problem, you need add return 1; at the end of command because in this case CallLocalFunction from zcmd returns 0 so 'success' is always false
pawn Код:
CMD:aa(playerid,params[])
{
SetPlayerPos(playerid, 404.7529,2439.8262,16.5000);
SendClientMessage(playerid,COLOR_YELLOW,"Welcome to Abandand Airport.");
GameTextForPlayer(playerid,"~w~Abandand Airport",3000,4);
return 1;
}
Posts: 193
Threads: 56
Joined: Jul 2015
Reputation:
0
alright thanks
EDIT: will reputate when i can