Help me [+rep]
#1

Guys i have Bug and idk how to Fix it
When i do exepmle /cc to clearchat he work But i get message UNKOWN COMMAND
and that message i take it from all command

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success)
    {
     GameTextForPlayer(playerid,"~r~USE ~y~/COMMANDS FOR A LIST OF COMMANDS!",5000,5);
    }
    return 1;
}
+rep if you help me And sry for bad english
Reply
#2

pawn Код:
CMD:cc(playerid,params[])
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new string[128];
    for(new i = 0; i < 50; i++) SendClientMessageToAll(0x00000000," ");
    format(string, sizeof(string), "{FFCC33}Administrator {15FF00}%s {FFCC33}has cleared the chat !", name);
    SendClientMessageToAll(-1, string);
    return 1;
}
Reply
#3

man when i type any command i get an unknown command
Reply
#4

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) GameTextForPlayer(playerid,"~r~USE ~y~/COMMANDS FOR A LIST OF COMMANDS!",5000,5);
    return 1;
}
Reply
#5

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) return GameTextForPlayer(playerid,"~r~USE ~y~/COMMANDS FOR A LIST OF COMMANDS!",5000,5);
    return 1;
}
Reply
#6

same probleme
Reply
#7

You want to use OnPlayerCommandReceived instead.
Reply
#8

i wanna say that when i type a command = IT work

BUT the ERROR MESSAGE ( SERVER:UNKNOWN COMMAND) APPEAR WITH IT
Reply
#9

Use this for unknown command:


pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
    if(!success )
        return SendClientMessage( playerid, 0xFF0000FF, "Add message here for unknown command" ); // add message and change color
    return 1;
}
For the clear chat (USING ZCMD):

pawn Код:
CMD:cc(playerid, params[])
{
    if(pInfo[playerid][pAdmin] < 2)
        return PlayerIsNotAdmin( playerid );

    for(new i = 0; i < 50; i++)SendClientMessageToAll(COLOR_WHITE," ");
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"[CLEAR CHAT] Administrator %s has cleared the chat!",pName);
    SendClientMessageToAll(RED,string);

    return 1;
}
But remember not to use both zcmd and the original way of making commands. Just use one of them for all of the commands. There are also already a few topics about this, so just search first
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)