Add gate cmd

This commit is contained in:
Vortrex
2022-01-19 13:03:59 -06:00
parent c1ec7c2fc4
commit b968db40fd
2 changed files with 18 additions and 4 deletions

View File

@@ -100,4 +100,21 @@ function getClosestGate(position) {
return closest; return closest;
} }
// ===========================================================================
function triggerGateCommand(command, params, client) {
let closestGate = getClosestGate(getPlayerPosition(client));
if(!getGateData(closestGate)) {
messagePlayerError(client, getLocaleString(client, "InvalidGate"));
}
if(!canPlayerUseGate(client, closestGate)) {
messagePlayerError(client, getLocaleString(client, "NoGateAccess"));
return false;
}
triggerGate(getGateData(closestGate).scriptName);
}
// =========================================================================== // ===========================================================================

View File

@@ -456,7 +456,4 @@ function gpsCommand(command, params, client) {
} }
blinkGenericGPSBlipForPlayer(client, getColourByType("businessBlue"), 10); blinkGenericGPSBlipForPlayer(client, getColourByType("businessBlue"), 10);
} }
// ===========================================================================