SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/12/2012, 05:07 AM   #1
Zex Tan
Huge Clucker
 
Join Date: Mar 2012
Location: South Australia
Posts: 305
Reputation: 48
Default Faction

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 Code:
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
Zex Tan is offline   Reply With Quote
Old 28/12/2012, 05:11 AM   #2
MattSlater
Huge Clucker
 
Join Date: Dec 2012
Posts: 206
Reputation: 4
Default Re: Faction

pawn Code:
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
MattSlater is offline   Reply With Quote
Old 28/12/2012, 05:31 AM   #3
Zex Tan
Huge Clucker
 
Join Date: Mar 2012
Location: South Australia
Posts: 305
Reputation: 48
Default Re: Faction

Quote:
Originally Posted by MattSlater View Post
pawn Code:
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 .
Zex Tan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Map] [MAP] Ls Faction Zones ( 4 Faction Zone ) Lynax Maps 7 14/09/2009 10:06 PM


All times are GMT. The time now is 11:33 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.