[HELP]Server: Unknown Command!
#1

Hello, i have a BIG problem with my script! Every time when i enter a command, no matter which command it says SERVER: Unknown Command!
No commands are working
I set the return to 1 at the end of OnPlayerCommandText....
What now?

Thanks.
Reply
#2

Wtf, why have you set the return to 1? It MUST be 0.
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    cmds_here{}
    return 0; // OnPlayerCommandText MUST return 0.
}
Reply
#3

Show us one of your commands.
'Could be what Mean said and maybe you returned your command as 'false'.
Reply
#4

every command has to return something?
Reply
#5

Has to return as true.
Reply
#6

hmm, i set every single command to return 1 at the end, but still nothing
Reply
#7

Quote:
Originally Posted by xRyder
Посмотреть сообщение
Show us one of your commands.
The message you have entered is too short. Please lengthen your message to at least 4 characters.
Reply
#8

pawn Код:
if(strcmp(cmd, "/usedrugs", true) == 0) // Drug system
    {
        if(IsPlayerConnected(playerid))
        {
            if(UsingDrugs[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_NICERED,"You have to wait 5 seconds!");
                return 1;
            }
            else
            {
                if(PlayerInfo[playerid][pDrugs] >= 1)
                {
                    new Float:health
                    GetPlayerHealth(playerid, health)
                    if(health >= 95.0)
                    {
                        SetPlayerHealth(playerid, 100.0);
                    }
                    if(health == 100.0)
                    {
                        SendClientMessage(playerid,COLOR_NICERED,"Your health is already full!");
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid,COLOR_YELLOW,"You used 2 grams of drugs!");
                        SetPlayerHealth(playerid, health + 5.0);
                        PlayerInfo[playerid][pDrugs] -= 2;
                        UsingDrugs[playerid] = 1;
                        SetTimerEx("DrugEffectGone", 5000, false, "i", playerid);
                    }
                }
                else
                {
                    SendClientMessage(playerid,COLOR_NICERED,"You have no more drugs!");
                }
            }
        }
        return 1;
    }
Reply
#9

It MUST return 1; or return true, else you will get: Server: Unknown command.
Reply
#10

Delete.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)