How to add faction vehicle
#1

I have mode that based on The godfather GM and i would like to add faction vehicle like LSPD in any position, how can i do it? i want it that when someone attemps to enter this vehicle as driver it will say to him "You are not in LSPD" (if he in LSPD so it will let him)
in generally i want how to add faction vehicle like ambulance and pawn it that civilians cant enter only FDSA people.
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
Under the OnPlayerEnterVehicle callback, check the vehicle model
pawn Код:
if(GetVehicleModel(GetPlayerVehicleId(playerid)) == LSPD_VEH_ID) // change it to the lspd vehicle ID, ****** it.
{
      RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, COLOR_RED, "[SERVER]{FFFFFF}: You are not a police officer, you do not have the keys for this vehicle!");
}
Reply
#3

Example Ripped from GM:
Код:
new LSPDVehicles[ 70 ]; // Place this near your usual new's location


IsACopCar(carid)
{
	for(new v = 0; v < sizeof(LSPDVehicles); v++)
	{
		if(carid == LSPDVehicles[v]) return 1;
	}
	return 0;
}


LSPDVehicles[0] = AddStaticVehicleEx(596,1602.0660,-1683.9678,5.6124,90.3080,0,1, VEHICLE_RESPAWN); // Cruiser
- This was ripped from a game-mode this is pretty much required for the 'God Father GM'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)