06.12.2011, 12:28
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(IsCopCar(GetPlayerVehicleID(playerid)) && !IsCopSkin(GetPlayerSkin(playerid)))//is its a law vehicle and he is not wearing a cop skin
{
RemovePlayerFromVehicle(playerid);
}
}
}
stock IsCopCar(carid)
{
new Operative[] = { 523, 427, 490, 528, 596, 597, 598, 599 };
for(new i = 0; i < sizeof(Operative); i++)
{
if(GetVehicleModel(carid) == Operative[i]) return 1;
}
return 0;
}
stock IsCopSkin(skinid)
{
new Operative[] = { 165, 166, 280, 281, 282, 283, 288, 284, 285, 286, 287 };
for(new i = 0; i < sizeof(Operative); i++)
{
if(skinid == Operative[i]) return 1;
}
return 0;
}