[Include] y_commands - Most flexible and fastest command processor, now on the YSI wiki
#8

Quote:
Originally Posted by RaeF
View Post
in YSI 3.0 :
PHP Code:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if (!
success// You can also write it as if (success == 0)
    
{
        
// Your code here 
    
}
    return 
1;

in YSI 4.0 or newer:
PHP Code:
/*
        Error & Return type
    COMMAND_ZERO_RET      = 0 , // The command returned 0.
    COMMAND_OK            = 1 , // Called corectly.
    COMMAND_UNDEFINED     = 2 , // Command doesn't exist.
    COMMAND_DENIED        = 3 , // Can't use the command.
    COMMAND_HIDDEN        = 4 , // Can't use the command don't let them know it exists.
    COMMAND_NO_PLAYER     = 6 , // Used by a player who shouldn't exist.
    COMMAND_DISABLED      = 7 , // All commands are disabled for this player.
    COMMAND_BAD_PREFIX    = 8 , // Used "/" instead of "#", or something similar.
    COMMAND_INVALID_INPUT = 10, // Didn't type "/something".
*/
public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playeridcmdtext[], e_COMMAND_ERRORS:success)
{
    switch (
success)
    {
        case 
COMMAND_UNDEFINED:
        {
             
// Your code here.
        
}
    }
    return 
COMMAND_OK;

It didn't work. I'm using YSI 4.0.

Code:
public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
    switch (success)
    {
        case COMMAND_UNDEFINED:
        {
            SendErrorMessage(playerid, "Bu komut mevcut değil. Komut listesini gцrmek iзin /yardim yazın.");
        }
    }
    return COMMAND_OK;
}
Reply


Messages In This Thread
y_commands - Most flexible and fastest command processor, now on the YSI wiki - by corne - 15.04.2015, 18:46
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by SickAttack - 16.04.2015, 05:29
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Crayder - 16.04.2015, 05:41
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by corne - 16.04.2015, 14:04
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Max_Andolini - 02.06.2015, 12:55
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by [KHK]Khalid - 02.06.2015, 16:21
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by RaeF - 03.06.2015, 12:09
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Max_Andolini - 03.06.2015, 13:18
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by RaeF - 03.06.2015, 23:13
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by justice96 - 27.07.2015, 08:24
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Crayder - 27.07.2015, 08:35
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by JaydenJason - 27.07.2015, 09:34
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by justice96 - 27.07.2015, 11:48
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by RaeF - 27.07.2015, 12:21
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by justice96 - 27.07.2015, 12:28
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Crayder - 27.07.2015, 16:26
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Kruzz - 02.12.2015, 18:45
Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Crayder - 02.12.2015, 19:52
Respuesta: Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Zume - 02.12.2015, 22:42
Re: Respuesta: Re: y_commands - Most flexible and fastest command processor, now on the YSI wiki - by Crayder - 03.12.2015, 01:41

Forum Jump:


Users browsing this thread: 1 Guest(s)