Add gotoloc cmd handler
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user