Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [RemoteEvent("StartTaxiJob")]
- public void StartTaxiJob(Player player)
- {
- JobVehiclesVar Tveh = null;
- foreach (JobVehiclesVar Veh in JobVehiclesVar.JOB_VEHICLE_LIST)
- {
- if(Veh.JobVehicleOwner == player)
- {
- if(Veh.JobVehicleType == (int)JobVehType.JOB_VEH_TAXI)
- {
- Tveh = Veh;
- break;
- }
- }
- }
- if (Tveh != null)
- {
- if (NAPI.Vehicle.GetVehicleDriver(Tveh.JobVehicleHolder) == player)
- {
- if (!TaxiStatus[player.Id])
- {
- if (Fun.IsPlayerInJob(player))
- {
- return;
- }
- if (!Fun.IsPlayerCivilian(player))
- {
- Fun.SendNotification(player, "This job is only for civilian class");
- return;
- }
- Fun.SendNotification(player, "Taxi job started~n~To cancel the job use ~y~/canceltaxi");
- TaxiStatus[player.Id] = true;
- player.TriggerEvent("StartTaxiClient", Tveh.JobVehicleHolder);
- }
- }
- }
- else
- {
- if (Fun.IsInRangeOfPoint(player.Position, new Vector3(-249.83844, -313.43216, 30.16217), 2))
- {
- if (!TaxiStatus[player.Id])
- {
- if (!Fun.IsPlayerCivilian(player))
- {
- Fun.SendNotification(player, "This job is only for civilian class");
- return;
- }
- if (Fun.IsPlayerInJob(player))
- {
- return;
- }
- JobVehiclesVar JobVeh = new JobVehiclesVar();
- JobVeh.JobVehicleOwner = player;
- JobVeh.JobVehicleType = (int)JobVehType.JOB_VEH_TAXI;
- JobVeh.JobVehicleRefueling = false;
- JobVeh.JobVehicleFuel = 1000;
- JobVeh.JobVehicleHolder = NAPI.Vehicle.CreateVehicle(VehicleHash.Taxi, new Vector3(-249.83844, -313.43216, 30.16217), -136.12138f, 1, 2, "Txi");
- NAPI.Player.SetPlayerIntoVehicle(player, JobVeh.JobVehicleHolder, 0);
- JobVehiclesVar.JOB_VEHICLE_LIST.Add(JobVeh);
- Fun.SendNotification(player, "Taxi job started~n~To cancel the job use ~y~/canceltaxi");
- TaxiStatus[player.Id] = true;
- player.TriggerEvent("StartTaxiClient", Tveh.JobVehicleHolder);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment