Skip to content

Instantly share code, notes, and snippets.

@ejb1123
Created May 17, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ejb1123/102fafa42ddf74d9542f35da2fb53e83 to your computer and use it in GitHub Desktop.
Save ejb1123/102fafa42ddf74d9542f35da2fb53e83 to your computer and use it in GitHub Desktop.
FiveMTraintest
using CitizenFX.Core;
using CitizenFX.Core.Native;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test
{
class train : BaseScript
{
public train()
{
Tick += Train_Tick;
}
private async Task Train_Tick()
{
if (Game.IsControlJustPressed(0, Control.Cover)) LocalPlayer.Character.Position = new Vector3(2057.99f, 3651.983f, 37.5503f);
if (Game.IsControlJustPressed(0, Control.MultiplayerInfo))
{
VehicleHash[] h = { VehicleHash.Freight, VehicleHash.FreightCar, VehicleHash.FreightGrain, VehicleHash.FreightCont1, VehicleHash.FreightCont2, VehicleHash.FreightTrailer };
foreach (var t in h)
{
await new Model(t).Request(-1);
}
Function.Call(Hash.CREATE_MISSION_TRAIN, 2, 2057.99, 3651.983, 37.5503, true);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment