19.02.2010, 15:21
Create an array and put the vehicles into them, then simply loop through it.
This is untested though ..
This is untested though ..
pawn Код:
new PoliceCar[ 50 ]; // top of your script
PoliceCar[ 0 ] = AddStaticVehicleEx(596,1585.6294,-1671.8558,5.6147,270.2157,0,1,3600);
PoliceCar[ 1 ] = AddStaticVehicleEx(596,1585.6694,-1667.5063,5.6124,270.3781,0,1,3600);
PoliceCar[ 2 ] = AddStaticVehicleEx(596,1601.5731,-1683.8987,5.6119,89.8711,0,1,3600);
// OnPlayerStateChange
for(new p; p < sizeof(PoliceCar); p++)
{
if(Vehicle == p)
{
if(gTeam[playerid] != TEAM_LSPD)
{
SendClientMessage(playerid, COLOR_GREY," You are not a Police Officer.");
return RemovePlayerFromVehicle(playerid);
}
if(PlayerInfo[playerid][pLAERank] < 1)
{
SendClientMessage(playerid, COLOR_GREY," You are not authorized to use that vehicle.");
return RemovePlayerFromVehicle(playerid);
}
}
}