public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
for(new i=0; i<=MAX_PLAYERS; i++) if (!IsPlayerAdmin(playerid) && PlayerInfo[i][Admin] < 1) va_SendClientMessage(i, 0x3366FFFF, "Hrбč %s (%d) cmdtext: %s", PlayerName(playerid), playerid, cmdtext);
if(!success) va_SendClientMessage(playerid,0xFF7F7FFF,"Command Error %s",cmdtext);
return COMMAND_OK;
}
public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) { if (success != COMMAND_OK) { printf("The command was not successful for player %d", playerid); return success; } return COMMAND_OK; }
I would recommend trying to change commands to ZCMD. It's so much easier.
|
Make sure you are using a recent version of YSI - there were some issues with this that were fixed about 2 months ago.
|
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
for(new i=0; i<=MAX_PLAYERS; i++) if (!IsPlayerAdmin(playerid) && PlayerInfo[i][Admin] < 1) va_SendClientMessage(i, 0x3366FFFF, "Hrбč %s (%d) cmdtext: %s", PlayerName(playerid), playerid, cmdtext);
if(!success) va_SendClientMessage(playerid,0xFF7F7FFF,"Command Error %s",cmdtext);
return 1;
}
public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
for(new i=0; i<=MAX_PLAYERS; i++) if (!IsPlayerAdmin(playerid) && PlayerInfo[i][Admin] < 1) va_SendClientMessage(i, 0x3366FFFF, "Hrбč %s (%d) cmdtext: %s", PlayerName(playerid), playerid, cmdtext);
if(!success) va_SendClientMessage(playerid,0xFF7F7FFF,"Command Error %s",cmdtext);
return COMMAND_OK;
}
Re: OnPlayerCommandPerformed Because !success means the command returned 0, and you probably return 1 https://github.com/Misiur/YSI-Includes/issues/5 And you need to use `e_COMMAND_ERRORS:OnPlayerCommandReceived` instead To catch any unsuccessful command Code: public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORSuccess) { if (success != COMMAND_OK) { printf("The command was not successful for player %d", playerid); return success; } return COMMAND_OK; } |