From 0f6a7e4afbf272753a86573b92204b1838fb5436 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 11 Dec 2021 20:18:16 -0600 Subject: [PATCH] Add GPS command --- scripts/server/misc.js | 65 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 7224db29..f95daade 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -371,7 +371,7 @@ function listOnlineAdminsCommand(command, params, client) { let admins = []; let clients = getClients(); for(let i in clients) { - if(getPlayerData(clients[i]) != false) { + if(getPlayerData(clients[i])) { if(getPlayerData(clients[i]).accountData.flags.admin != 0) { admins.push(`{ALTCOLOUR}[${getPlayerData(clients[i]).accountData.staffTitle}] {MAINCOLOUR}${getCharacterFullName(clients[i])}`); } @@ -384,4 +384,65 @@ function listOnlineAdminsCommand(command, params, client) { } } -// =========================================================================== \ No newline at end of file +// =========================================================================== + +function gpsCommand(command, params, client) { + //== Businesses =================================== + messagePlayerNormal(client, `{clanOrange}== {jobYellow}Businesses {clanOrange}================================`); + + switch(toLowerCase(params)) { + case "skin": + case "skins": + case "clothes": + useType = VRR_ITEM_USETYPE_SKIN; + break; + + case "gun": + case "guns": + case "weapon": + case "weapons": + case "wep": + useType = VRR_ITEM_USETYPE_WEAPON; + break; + + case "food": + case "eat": + useType = VRR_ITEM_USETYPE_FOOD; + break; + + case "drink": + useType = VRR_ITEM_USETYPE_DRINK; + break; + + case "repair": + useType = VRR_ITEM_USETYPE_VEHREPAIR; + break; + + case "colour": + useType = VRR_ITEM_USETYPE_VEHCOLOUR; + break; + + default: { + let itemTypeId = getItemTypeFromParams(params); + if(getItemTypeData(itemTypeId)) { + useType = getItemTypeData(itemTypeId).useType; + } + } + } + + let businessId = getClosestBusinessWithBuyableItemOfUseType(useType); + if(!businessId) { + messagePlayerError(client, `There is no business with that item available`); + return false; + } + + if(!getBusinessData(businessId)) { + messagePlayerError(client, `There is no business with that item available`); + return false; + } + + blinkGenericGPSBlipForPlayer(client, getColourByType("businessBlue"), 10); +} + +// =========================================================================== +