New universal lock command

This commit is contained in:
Vortrex
2022-04-18 20:58:23 -05:00
parent 55b2c9e22c
commit c1d27f7fb6
4 changed files with 154 additions and 77 deletions

View File

@@ -99,39 +99,6 @@ function createHouseCommand(command, params, client) {
// ===========================================================================
/**
* This is a command handler function.
*
* @param {string} command - The command name used by the player
* @param {string} params - The parameters/args string used with the command by the player
* @param {Client} client - The client/player that used the command
* @return {bool} Whether or not the command was successful
*
*/
function lockUnlockHouseCommand(command, params, client) {
let houseId = getPlayerHouse(client);
if(!getHouseData(houseId)) {
messagePlayerError(client, getLocaleString(client, "InvalidHouse"));
return false;
}
getHouseData(houseId).locked = !getHouseData(houseId).locked;
//for(let i in getHouseData(houseId).locations) {
// if(getHouseData(houseId).locations[i].type == VRR_HOUSE_LOC_DOOR) {
// setEntityData(getHouseData(houseId).locations[i].entrancePickup, "vrr.label.locked", getHouseData(houseId).locked, true);
// }
//}
setEntityData(getHouseData(houseId).entrancePickup, "vrr.label.locked", getHouseData(houseId).locked, true);
getHouseData(houseId).needsSaved = true;
messagePlayerSuccess(client, `House {houseGreen}${getHouseData(houseId).description} {MAINCOLOUR}${getLockedUnlockedFromBool((getHouseData(houseId).locked))}!`);
}
// ===========================================================================
/**
* This is a command handler function.
*