Problem[Help]
#1

how supposed to work:if leader 1 types /fac all of pd faction sees message..
Problem:if leader 1 types /fac everybody from server sees it..rep if you need!

PHP код:
if(!strcmp(cmdtext"/fac"true))
                    {
                        if(
IsPlayerConnected(playerid))
                        {
                            if(
PlayerInfo[playerid][pLeader] == 1)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsACopCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 2)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAFbiCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 3)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsANgCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 4)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAFireCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 5)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAGustaCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 6)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAMafiaCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 7)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAGovernmentCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 8)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAYepCar(car)) SetVehicleToRespawn(car);
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 9)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsANrCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                                return 
1;
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 10)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsATaxiCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 11)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAMSCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 12)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAGlenCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 13)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsAGangCar7(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 14)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsANapCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 15)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsATowCar(car)) SetVehicleToRespawn(car);
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            else if(
PlayerInfo[playerid][pLeader] == 16)
                            {
                                new 
bool:unwanted[CAR_AMOUNT];
                                for(new 
player=0player<MAX_PLAYERSplayer++)
                                {
                                    if(
IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                                }
                                for(new 
car 1car <= 400car++)
                                {
                                    if(
IsATigaCar(car)) SetVehicleToRespawn(car);
                                    
GetPlayerName(playeridsendernamesizeof(sendername));
                                    
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
                                }
                            }
                            
SendFamilyMessage(playeridCOLOR_LIGHTBLUEstring);
                            return 
1;
                        }
                        return 
1;
                    } 
Reply
#2

PHP код:
public SendFamilyMessage(familycolorstring[])
                    {
                    for(new 
0MAX_PLAYERSi++)
                    {
                    if(
IsPlayerConnected(i))
                    {
                    if(
PlayerInfo[i][pMember] == family || PlayerInfo[i][pLeader] == family)
                    {
                        if(!
gFam[i])
                        {
                            
SendClientMessage(icolorstring);
                        }
                    }
                    }
                    }
                    } 
Reply
#3

anyone help??
Reply
#4

anyone?
Reply
#5

Post the errorss and stuff.
Reply
#6

no errors..
Reply
#7

i want it so it send seprtly to each member/leader i dont want Y to /fac and see all members from U faction..get it?i want all Y members including leader to see message.
Reply
#8

replace this
PHP код:
SendFamilyMessage(playeridCOLOR_LIGHTBLUEstring); 
by this
PHP код:
SendFamilyMessage(PlayerInfo[playerid][pLeader], COLOR_LIGHTBLUEstring); 
You can rep me if you want and if you are so generous
Reply
#9

i want to whole faction..not faction's..
Reply
#10

Yes, this message is sended to all the players who is in the faction of the leader

(very bad english, i know :/)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)