Ragemp-roleplay-skript/Jobs/Greenkeeper/Greenkeeper.ts
2019-04-16 13:59:07 +02:00

27 lines
No EOL
1.4 KiB
TypeScript

/// <reference path="../../types-gtanetwork/index.d.ts" />
var marker = null;
API.onServerEventTrigger.connect(function (eventName, args) {
if (eventName == "job:generate:marker") {
var id = args[0];
if (id == 1) {
marker = null;
marker = API.createMarker(1, new Vector3(-1288.488, 53.28987, 50.44), new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0.8, 0.8, 0.8), 255, 0, 0, 185);
API.setWaypoint(-1288.488, 53.28987);
} else if (id == 2) {
API.deleteEntity(marker);
marker = API.createMarker(1, new Vector3(-1206.227, 23.28249, 48.25), new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0.8, 0.8, 0.8), 255, 0, 0, 185);
API.setWaypoint(-1206.227, 23.28249);
} else if (id == 3) {
API.deleteEntity(marker);
marker = API.createMarker(1, new Vector3(-1188.594, -29.88, 44.61), new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0.8, 0.8, 0.8), 255, 0, 0, 185);
API.setWaypoint(-1188.594, -29.88);
} else if (id == 4) {
API.deleteEntity(marker);
marker = API.createMarker(1, new Vector3(-1139.745, -61.15126, 43.03), new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0.8, 0.8, 0.8), 255, 0, 0, 185);
API.setWaypoint(-1139.745, -61.15126);
}
} else if (eventName == "destroyMarker") {
API.deleteEntity(marker);
}
});