Quote:
Originally Posted by RaeF
in YSI 3.0 :
PHP Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], 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(playerid, cmdtext[], 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;
}