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

@@ -101,3 +101,20 @@ function getClosestGate(position) {
} }
// =========================================================================== // ===========================================================================
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

@@ -457,6 +457,3 @@ function gpsCommand(command, params, client) {
blinkGenericGPSBlipForPlayer(client, getColourByType("businessBlue"), 10); blinkGenericGPSBlipForPlayer(client, getColourByType("businessBlue"), 10);
} }
// ===========================================================================