Locking Vehicles
#2

Here you go man.

Код:
stock IsACopCar(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 523,427,528,596,598,597,599,601,497,430: return 1;
    }
    return 0;
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(IsACopCar(vehicleid) && !ispassenger)
	{
             if(Groups[Player[playerid][Group]][CommandTypes] == 1)
	    {
                        SendClientMessage(playerid, -1, "You are not a cop!");
			ClearAnimations(playerid);
		}
	}
}
This isn't actually "locking" them, but disabling them for use. If you wanted to lock them and only allow cops to unlock it that's a pretty simple function just use GetVehicleParamsEx and SetVehicleParamsEx but players will be able to drive the vehicle if it's unlocked.
Reply


Messages In This Thread
Locking Vehicles - by Kalkor - 15.12.2014, 04:40
Re: Locking Vehicles - by Divergent - 15.12.2014, 04:56
Re: Locking Vehicles - by Kalkor - 15.12.2014, 05:07
Re: Locking Vehicles - by Divergent - 15.12.2014, 05:16
Re: Locking Vehicles - by Kalkor - 15.12.2014, 05:45
Re: Locking Vehicles - by Divergent - 15.12.2014, 05:47

Forum Jump:


Users browsing this thread: 1 Guest(s)