SA-MP Forums Archive
Team Chat....... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team Chat....... (/showthread.php?tid=224127)



Team Chat....... - Unknown123 - 11.02.2011

when i type "/cm" i get this:
USAGE: /cm (message)
SERVER: Unknown Command


and sometimes it gets an random player id

/cm Hello
cop msg: Unknown(156) Hello
SERVER: Unknown Command



What am i doing wrong
pawn Код:
dcmd_cm(playerid, params[])
{
    if(gTeam[playerid] == TEAM_COP ||gTeam[playerid] == TEAM_AIRCOP ||gTeam[playerid] == TEAM_MARINECOP)
    {
        new message[128];
        if(sscanf(params, "s[128]", message)) SendClientMessage(playerid, COLOR_USAGE, "USAGE: /cm (message)");
        else
        {
            new playername[MAX_PLAYER_NAME], string[128];
            GetPlayerName(playerid, playername, sizeof(playername));

            format(string, sizeof(string), "cop msg: %s(%d) %s", playername, playerid, message);
            SendPoliceTeamMessage(COLOR_TEAMCHAT, string);
            return 1;
        }
    }
    return 0;
}
pawn Код:
public SendPoliceTeamMessage(color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(gTeam[i] == TEAM_COP ||gTeam[i] == TEAM_AIRCOP ||gTeam[i] == TEAM_MARINECOP)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}



Re: Team Chat....... - [WF]Demon - 11.02.2011

instead of returning 0 on the end of the command return 1


Re: Team Chat....... - Unknown123 - 11.02.2011

Quote:
Originally Posted by Crodox RP
Посмотреть сообщение
instead of returning 0 on the end of the command return 1
... I didnt see it was 'return 0;' LoL Thanks