Faction - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Faction (
/showthread.php?tid=402805)
Faction -
Zex Tan - 28.12.2012
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
pawn Код:
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
Re: Faction -
MattSlater - 28.12.2012
pawn Код:
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
Re: Faction -
Zex Tan - 28.12.2012
Quote:
Originally Posted by MattSlater
pawn Код:
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 .