Add gotoloc cmd handler

This commit is contained in:
Vortrex
2021-03-15 12:32:15 -05:00
parent 9501edb5c3
commit 35ec13850d

View File

@@ -249,6 +249,31 @@ function gotoBusinessCommand(command, params, client) {
// ---------------------------------------------------------------------------
function gotoGameLocationCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let gameLocationId = getGameLocationFromParams(params)
if(!gameLocationId) {
messagePlayerError(client, "That game location doesn't exist!");
return false;
}
setPlayerVelocity(client, toVector3(0.0, 0.0, 0.0));
setTimeout(function() {
setPlayerPosition(client, getGameData().locations[businessId][1]);
setPlayerInterior(client, 0);
setPlayerDimension(client, 0);
}, 500);
messagePlayerSuccess(client, `You teleported to game location [#AAAAAA]${getGameData().locations[businessId][0]}`);
}
// ---------------------------------------------------------------------------
function gotoHouseCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));