OnPlayerCommandPerformed
#1

When I enter the wrong command it will not show me that I have entered a bad command.
I use YSI 4.0

PHP код:
public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playeridcmdtext[], e_COMMAND_ERRORS:success)
{
    for(new 
i=0i<=MAX_PLAYERSi++) if (!IsPlayerAdmin(playerid) && PlayerInfo[i][Admin] < 1va_SendClientMessage(i0x3366FFFF"Hrбč %s (%d) cmdtext: %s"PlayerName(playerid), playeridcmdtext);
    if(!
successva_SendClientMessage(playerid,0xFF7F7FFF,"Command Error %s",cmdtext);
     return 
COMMAND_OK;

Reply
#2

I would recommend trying to change commands to ZCMD. It's so much easier.
Reply
#3

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
Код:
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;
}
Reply
#4

Quote:
Originally Posted by Pizzy
Посмотреть сообщение
I would recommend trying to change commands to ZCMD. It's so much easier.
Are you just stupid or mentally challanged?
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
Make sure you are using a recent version of YSI - there were some issues with this that were fixed about 2 months ago.
I use the latest version 4.0

or
in version 3.0 this is how
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    for(new 
i=0i<=MAX_PLAYERSi++) if (!IsPlayerAdmin(playerid) && PlayerInfo[i][Admin] < 1va_SendClientMessage(i0x3366FFFF"Hrбč %s (%d) cmdtext: %s"PlayerName(playerid), playeridcmdtext);  
    if(!
successva_SendClientMessage(playerid,0xFF7F7FFF,"Command Error %s",cmdtext);  
    return 
1;

else YSI 4.0

PHP код:
public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playeridcmdtext[], e_COMMAND_ERRORS:success

    for(new 
i=0i<=MAX_PLAYERSi++) if (!IsPlayerAdmin(playerid) && PlayerInfo[i][Admin] < 1va_SendClientMessage(i0x3366FFFF"Hrбč %s (%d) cmdtext: %s"PlayerName(playerid), playeridcmdtext); 
    if(!
successva_SendClientMessage(playerid,0xFF7F7FFF,"Command Error %s",cmdtext); 
     return 
COMMAND_OK

Quote:

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;
}

So I use this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)