help with chat
#1

How do I make a /r chat for the team (id 6) ?
Reply
#2

Just an example:

pawn Код:
COMMAND:r(playerid, params[]) {
    new string[128];
    if (GetPlayerTeam(playerid) != 6) return SendClientMessage(playerid, COLOR_RED, "Your Not Team 6!");
    if (sscanf(params, "s", string)) return SendClientMessage(playerid, COLOR_RED, "/r <message>");
    for (new i = 0; i < MAX_PLAYERS; i++) {
        if (GetPlayerTeam(i) == 6) {
            new name[24]; GetPlayerName(i, name, 24);
            format(string, 128, "TEAM %s: %s", name, string);
            SendClientMessage(i, COLOR_WHITE, string);
        }
    }
    return 1;
}
Basically check if their team is 6, if so, get the parameter, the 'string' or message.
Then send it to everyone who's on team 6.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)