Skip to content

Instantly share code, notes, and snippets.

@aumars
Last active March 4, 2017 10:20
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 aumars/3d5324152d1bcfdb1d693325f9f58dae to your computer and use it in GitHub Desktop.
Save aumars/3d5324152d1bcfdb1d693325f9f58dae to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Text;
namespace Checkpoint
{
public class checkpoint : GTA.Script
{
public checkpoint()
{
BindConsoleCommand("drive", new GTA.ConsoleCommandDelegate(drive), this);
}
public void drive(string[] args)
{
float target.pX = GTA.Native.CallOpcode(0A8D, 13099016, 4, 0);
float target.pY = GTA.Native.CallOpcode(0A8D, 13099020, 4, 0);
float target.pZ = GTA.Native.CallOpcode(0A8D, 13099024, 4, 0);
if (target.pX == 0 && target.pY == 0 && target.pZ && 0)
{
GTA.Console.WriteLine("ERROR: Checkpoint not found.");
}
else
{
Car car = GTA.Car.HandleObject Driver;
GTA.Native.CallOpcode(0704, car, target.pX, target.pY, target.pZ);
GTA.Console.WriteLine("Script activated. Driving to checkpoint.");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment