05.10.2011, 19:51
Like so:
If you want more police cars to be unavailable to civilians, you need to add more separate vehicles using the variables I showed above (PDCar1, PDCar2, etc..)
https://sampwiki.blast.hk/wiki/Skins:Public
https://sampwiki.blast.hk/wiki/AddStaticVehicle
pawn Код:
// top of script
new PDCar1; // first police department car
// under ongamemodeinit
PDCar1 = AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2);
// under onplayerstatechange
new vehicleid = GetPlayerVehicleID(playerid);
new skin = GetPlayerSkin(playerid);
if(skin != 165 || skin != 281 || skin != 282) // if the skin is not equal to these skin id's (few police officer skins)
{
if(newstate == PLAYER_STATE_DRIVER && vehicleid == PDCar1)
{
RemovePlayerFromVehicle(playerid); // Ejects the player from the vehicle.
SendClientMessage(playerid, -1, "This Vehicle Is For Use By Law Enforcement Only. You Cannot Use This Vehicle.");
GameTextForPlayer(playerid,"~w~ejected from the vehicle",5000,3);
return 1;
}
}
https://sampwiki.blast.hk/wiki/Skins:Public
https://sampwiki.blast.hk/wiki/AddStaticVehicle