Last active
March 4, 2017 10:20
-
-
Save aumars/3d5324152d1bcfdb1d693325f9f58dae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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