PDA

View Full Version : Faction


Zex Tan
28/12/2012, 05:07 AM
Well, I have 2 factions and each player has its own faction and I want line 157 that can SendMessage to faction 1 and the Another Faction has its own Message. Hope you can understand what I mean, Sorry for bad English


stock SendMessageToFaction(playerid, color, const string[]) //153
{ //154
for(new i = 0; i < MAX_PLAYERS; i++) //155
{ //156
if(PlayerInfo[i][Faction] >=1) //157
if(PlayerInfo[i][Rank] >=1) //158
if(i != playerid) //159
{ //160
SendClientMessage(i, color, string); //161
} //162
} //163
return 1; //164
} //165

MattSlater
28/12/2012, 05:11 AM
stock SendMessageToFaction(playerid, color, const string[]) //153
{ //154
for(new i = 0; i < MAX_PLAYERS; i++) //155
{ //156
if(PlayerInfo[playerid][Faction] == PlayerInfo[i][Faction])
{
SendClientMessage(i, color, string);
}
} //163
return 1; //164
} //165


This will send the message to everyone that's in your faction, I presume that's what you wanted ;3

Zex Tan
28/12/2012, 05:31 AM
stock SendMessageToFaction(playerid, color, const string[]) //153
{ //154
for(new i = 0; i < MAX_PLAYERS; i++) //155
{ //156
if(PlayerInfo[playerid][Faction] == PlayerInfo[i][Faction])
{
SendClientMessage(i, color, string);
}
} //163
return 1; //164
} //165


This will send the message to everyone that's in your faction, I presume that's what you wanted ;3

Yes, I'll give it a try .