Sending Messages[Sovled]
#1

How do i send a messege from like,


TEAM_CIV,TEAM_POLICE?


Kinda like a 911 call.
Reply
#2

Код:
for(new a=0; a<MAX_PLAYERS; a++)
{
if(GetPlayerTeam(a) == TEAM_POLICE)
{
SendClientMessage(a,COLOR_BLUE,"Radio: Suspect down, Over.")
}
}
Reply
#3

I really don't understand that sorry, for some reason today i can't understand/remember shit??
Reply
#4

I hope only today

Код:
if(strcmp(cmd, "/sudown", true) == 0) {
if GetPlayerTeam(playerid, TEAM_POLICE) {
for(new a=0; a<MAX_PLAYERS; a++)
{
if(GetPlayerTeam(a) == TEAM_POLICE)
{
SendClientMessage(a,COLOR_BLUE,"Radio: Suspect down, Over.") // Define color if u dont have
}
}
}else{
SendClientMessage(a,COLOR_RED,"You are not a cop") // Define color if u dont have
return 1;
}
That should work
Reply
#5

Or simply create a function.
pawn Код:
stock SendMessageToTeam(    team,   color,  message[]   )
{
    for(new cC; cC < MAX_PLAYERS; cC++)
    {
        if(!IsPlayerConnected(cC)) continue;
        if(GetPlayerTeam(cC) != team) continue;
        SendClientMessage(cC, color, message);
    }
}

// Example usage:
SendMessageToTeam( TEAM_COPS,  COLOR_BLUE,   "Oh my bawls, emergency!");
Reply
#6

Yeah this is OK too!
Reply
#7

Nvm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)