Help with sendclientmessage
#1

Alright what im wanting is for when you attack a gang zone it sends a client message to everyone like so "GANG has initiated a turf war with GANG" Anyway to do this here is the code im using note the first get gang part works"

Код:
            for(new t=0; t < sizeof(Teams); t++) // loop all teams
            {
                if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR) // if there are enough enemies in the zone
                {
                    new string[128];
                    format(string,sizeof(string), "%s have initiated a gang war with %s",GetTeamName(playerid));
                    ZoneAttacker[i] = Teams[t];
                    ZoneAttackTime[i] = 0;
                    GangZoneFlashForAll(ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
                    SendClientMessageToAll(COLOR_LIME, string);
Reply
#2

you defined the teams ?
Reply
#3

Yes, I need it to send a message to every telling them which Gang attacked which zone
Reply
#4

pawn Код:
for(new t=0; t < sizeof(Teams); t++) // loop all teams
            {
                if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR) // if there are enough enemies in the zone
                {
                    new string[128];
                    format(string,sizeof(string), "%s have initiated a gang war with %s",GetTeamName(playerid));
                    ZoneAttacker[i] = Teams[t];
                    ZoneAttackTime[i] = 0;
                    GangZoneFlashForAll(ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
                    SendClientMessageToAll(COLOR_LIME, string);
pawn Код:
if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR)/*
u place the SendClientMessge to all under this.... so the only players seeing the message is the ones called under it*/
pawn Код:
// curious so it should like this
for(new t=0; t < sizeof(Teams); t++) // loop all teams
{
                if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR) // if there are enough enemies in the zone
                {
                    new string[128];
                    format(string,sizeof(string), "%s have initiated a gang war with %s",GetTeamName(playerid));
                    ZoneAttacker[i] = Teams[t];
                    ZoneAttackTime[i] = 0;
                    GangZoneFlashForAll(ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
                    SendClientMessageToAll(COLOR_LIME, string);
                  }
                  SendClientMessageToAll(COLOR_LIME, string);
}
secondly u have %s twice put only 1 value so u might wanna look at that
format(string,sizeof(string), "%s have initiated a gang war with %s",GetTeamName(playerid));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)