Y_Commands: all commands disabled for all players
#3

Quote:
Originally Posted by HireMe
Посмотреть сообщение
Can you show us the script / part of the script with some commands?
of course...

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(!PlayerIsLoggedIn[playerid]){
        SendClientMessage(playerid, -1, "Please log in!");
        return -1;
    }
    return 1;
}
here the commands part, something like...
pawn Код:
YCMD:commands(playerid, params[], help)
{
    if ( help ) return SendClientMessage(playerid, -1, "Shows the command list");
    new count = Command_GetPlayerCommandCount( playerid ), cmd[32];
    for ( new i = 0; i != count; ++i){
        format(cmd, sizeof(cmd), "/%s ", Command_GetNext ( i, playerid ));
                SendClientMessage(playerid, -1, cmd);
    }
   
    return 1;
}
finally...
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success){
    switch (success)
    {
        case 1:
        {
            return 1;
        }
        case -1:
        {
            return 0;
        }
        case 0:
        {
            SendClientMessage(playerid, -1, "Command not found, please use /commands to display the command list.");
            return 1;
        }
        default:
            return -1;
    }
    return 1;
}
Reply


Messages In This Thread
Y_Commands: all commands disabled for all players - by deb014 - 09.12.2012, 18:44
Re: Y_Commands: all commands disabled for all players - by HireMe - 09.12.2012, 21:28
Re: Y_Commands: all commands disabled for all players - by deb014 - 09.12.2012, 22:23

Forum Jump:


Users browsing this thread: 2 Guest(s)