Skin restricted vehicles
#2

Like so:

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;
    }
}
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
Reply


Messages In This Thread
Skin restricted vehicles - by needhack - 05.10.2011, 19:28
Re: Skin restricted vehicles - by grand.Theft.Otto - 05.10.2011, 19:51
Re: Skin restricted vehicles - by needhack - 05.10.2011, 20:28
Re: Skin restricted vehicles - by needhack - 14.10.2011, 16:32
Re: Skin restricted vehicles - by needhack - 16.10.2011, 19:04

Forum Jump:


Users browsing this thread: 2 Guest(s)