29.07.2017, 07:09
Quote:
Код:
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags) { if(result == -1) { SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command."); return 0; } return 1; } |
PHP код:
CMD:ajetpack(playerid)
{
if(pInfo[playerid][AdminLvl] < 2) return 0; // this will send result value as 0.
if(!AdmDuty{playerid}) return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"You must be on admin duty to use this command."), 0; // this will send result value as 0 as well.
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
SendClientMessage(playerid, COLOR_PINK, "* Spawned Jetpack.");
return 1; // this will send result value as 1.
}
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(!result) // if result is zero
return SendClientMessage(playerid, COLOR_RED, "ERROR: You're not permitted to use this command.");
return 1;
}
--------
Is PC_EmulateCommand supposed not to call "OnPlayerCommandPerformed"? Because it doesn't calls for me.