Team Chat.......
#1

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);
            }
        }
    }
}
Reply
#2

instead of returning 0 on the end of the command return 1
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)