24.09.2012, 13:45
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!
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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsACopCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAFbiCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsANgCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAFireCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAGustaCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAMafiaCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAGovernmentCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsANrCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsATaxiCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAMSCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAGlenCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsAGangCar7(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsANapCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
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=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 400; car++)
{
if(IsATigaCar(car)) SetVehicleToRespawn(car);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string), "Liderul vostru %s a respawnat masinile al factiuni!",sendername);
}
}
SendFamilyMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
return 1;
}