19.02.2010, 15:02
Hello, I'm using a hard type of this script, I have to give every car a name like PoliceCar1 and it's like 50 Police Cars.
Example:
So, as I was saying, it it possible to switch the names of the cars to the car's ID so I dont have to put names on every car and ad so many lines, like remove the PolceCar1 to the car id's so I only have to make one line on PlayerStateChange for all the police cars.
Thanks
Example:
Код:
new PoliceCar1 new PoliceCar2 new PoliceCar3
Код:
PoliceCar1 = AddStaticVehicleEx(596,1585.6294,-1671.8558,5.6147,270.2157,0,1,3600); PoliceCar2 = AddStaticVehicleEx(596,1585.6694,-1667.5063,5.6124,270.3781,0,1,3600); PoliceCar3 = AddStaticVehicleEx(596,1601.5731,-1683.8987,5.6119,89.8711,0,1,3600);
Код:
if(Vehicle == PoliceCar1)
{
if(gTeam[playerid] == TEAM_LSPD)
{
if(PlayerInfo[playerid][pLAERank] >= 1)
{
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not authorized to use that vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not a Police Officer.");
RemovePlayerFromVehicle(playerid);
}
}
if(Vehicle == PoliceCar2)
{
if(gTeam[playerid] == TEAM_LSPD)
{
if(PlayerInfo[playerid][pLAERank] >= 1)
{
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not authorized to use that vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not a Police Officer.");
RemovePlayerFromVehicle(playerid);
}
}
if(Vehicle == PoliceCar3)
{
if(gTeam[playerid] == TEAM_LSPD)
{
if(PlayerInfo[playerid][pLAERank] >= 1)
{
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not authorized to use that vehicle.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not a Police Officer.");
RemovePlayerFromVehicle(playerid);
}
}
Thanks



