SA-MP Forums Archive
Help me [+rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me [+rep] (/showthread.php?tid=546848)



Help me [+rep] - AYOUYOU - 18.11.2014

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



Re: Help me [+rep] - HY - 18.11.2014

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;
}



Re : Help me [+rep] - AYOUYOU - 18.11.2014

man when i type any command i get an unknown command


Re: Help me [+rep] - J0sh... - 18.11.2014

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



Re: Help me [+rep] - Accent - 18.11.2014

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



Re : Help me [+rep] - AYOUYOU - 18.11.2014

same probleme


Re: Help me [+rep] - Vince - 18.11.2014

You want to use OnPlayerCommandReceived instead.


Re : Help me [+rep] - AYOUYOU - 18.11.2014

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

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


Re: Help me [+rep] - FunnyBear - 18.11.2014

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