Bunch of fixes/changes

* Set client log level to info
* Added element prop sync util
* Added check to make sure veh upgrade was valid
* Fixed incorrect acct settings being saved
* Added help tip when using invalid anim
* Fixed create biz cmd
* Allow biz owners to set biz name
* Allow biz owners to give biz to player or clan
* Added biz clan rank cmd
* Allow those with permission to lock/unlock biz & houses
* Fix set biz interior
* Allow players with permission to withdraw from biz till
* Added utils to check if player has biz permissions for till/lock/lights
* Added check if players are in same int/vw on talk/shout/whisper
* Follow server civilians cvar when toggling ambience
* Renamed some clan cmds to prefix with "clan"
* Added vehlivery cmd
* Set server log level to debug
* Show veh owner info on enter
* Sync body parts & props on IV
* Add clan help in help cmd
* Don't show values for melee weapons
* Add IV support for some utils
* Sync player ped fight style in SA
* Added fightstyle cmd
* Fix wrong job owner on vehinfo cmd
* Return false on world label support util for IV
This commit is contained in:
Vortrex
2021-09-12 13:53:51 -05:00
parent ac4702cc52
commit cfc22a77ee
21 changed files with 680 additions and 128 deletions

View File

@@ -663,15 +663,18 @@ function playerUseItem(client, hotBarSlot) {
case VRR_ITEM_USETYPE_WALKIETALKIE:
getItemData(itemIndex).enabled = !getItemData(itemIndex).enabled;
messagePlayerAlert(client, `You turned ${getBoolRedGreenInlineColour(getItemData(itemIndex).enabled)}${toUpperCase(getOnOffFromBool(getItemData(itemIndex).enabled))} ${getInlineChatColourByName("white")}your walkie talkie in slot ${getPlayerData(client).activeHotBarSlot+1} ${getInlineChatColourByName("lightGrey")}(${getItemValueDisplayForItem(itemIndex)})`);
//messagePlayerAlert(client, `You turned ${getBoolRedGreenInlineColour(getItemData(itemIndex).enabled)}${toUpperCase(getOnOffFromBool(getItemData(itemIndex).enabled))} ${getInlineChatColourByName("white")}your walkie talkie in slot ${getPlayerData(client).activeHotBarSlot+1} ${getInlineChatColourByName("lightGrey")}${getItemValueDisplayForItem(itemIndex)}`);
meActionToNearbyPlayers(client, `turns ${toLowerCase(getOnOffFromBool(getItemData(itemIndex).enabled))} their walkie-talkie`);
break;
case VRR_ITEM_USETYPE_PHONE:
getItemData(itemIndex).enabled = !getItemData(itemIndex).enabled;
if(getItemData(itemIndex).enabled) {
messagePlayerAlert(client, `You turned on your phone in slot ${getPlayerData(client).activeHotBarSlot+1} (${getItemValueDisplayForItem(itemIndex)})`);
//messagePlayerAlert(client, `You turned on your phone in slot ${getPlayerData(client).activeHotBarSlot+1} ${getItemValueDisplayForItem(itemIndex)}`);
meActionToNearbyPlayers(client, `turns on their phone`);
} else {
messagePlayerAlert(client, `You turned OFF your phone in slot ${getPlayerData(client).activeHotBarSlot+1}`);
//messagePlayerAlert(client, `You turned OFF your phone in slot ${getPlayerData(client).activeHotBarSlot+1}`);
meActionToNearbyPlayers(client, `turns off their phone`);
}
break;
@@ -1357,9 +1360,14 @@ function playerItemActionDelayComplete(client) {
function getItemValueDisplayForItem(itemId) {
if(!getItemData(itemId)) {
return "unknown";
return "[unknown]";
}
return getItemValueDisplay(getItemData(itemId).itemTypeIndex, getItemData(itemId).value);
if(isMeleeWeapon(getItemTypeData(getItemData(itemId).itemTypeIndex).useId)) {
return "";
}
return `[${getItemValueDisplay(getItemData(itemId).itemTypeIndex, getItemData(itemId).value)}]`;
}
// ===========================================================================
@@ -1416,7 +1424,7 @@ function toggleItemEnabledCommand(command, params, client) {
}
getItemData(getPlayerActiveItem(client)).enabled = !getItemData(getPlayerActiveItem(client)).enabled;
messagePlayerNormal(client, `You turned ${getBoolRedGreenInlineColour(getItemData(itemIndex).enabled)}${toUpperCase(getOnOffFromBool(getItemData(itemIndex).enabled))} ${getInlineChatColourByName("white")}your ${getItemName(getPlayerActiveItem(client))} in slot ${getPlayerActiveItemSlot(client)} ${getInlineChatColourByName("lightGrey")}(${getItemValueDisplayForItem(getPlayerActiveItem(client))}`)
messagePlayerNormal(client, `You turned ${getBoolRedGreenInlineColour(getItemData(itemIndex).enabled)}${toUpperCase(getOnOffFromBool(getItemData(itemIndex).enabled))} ${getInlineChatColourByName("white")}your ${getItemName(getPlayerActiveItem(client))} in slot ${getPlayerActiveItemSlot(client)} ${getInlineChatColourByName("lightGrey")}${getItemValueDisplayForItem(getPlayerActiveItem(client))}`)
}
// ===========================================================================
@@ -1496,8 +1504,8 @@ function showBusinessFloorInventoryToPlayer(client, businessId) {
//itemDisplay.push(`${getInlineChatColourByType("jobYellow")}${toInteger(i)+1}${getInlineChatColourByName("lightGrey")}(Empty)`);
messagePlayerNormal(client, `${getInlineChatColourByName("yellow")}${toInteger(i)+1}${getInlineChatColourByName("lightGrey")}(Empty)`, COLOUR_WHITE);
} else {
//itemDisplay.push(`${getInlineChatColourByType("jobYellow")}${toInteger(i)+1}: ${getInlineChatColourByName("white")}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name}${getInlineChatColourByName("lightGrey")}[${getItemValueDisplayForItem(getBusinessData(businessId).floorItemCache[i])}] - [${(getPlayerCurrentSubAccount(client).cash<getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? rgbToHex(205, 60, 60) : rgbToHex(50, 205, 50)}]$${getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice} [#CCCCCC] - ${getItemData(getBusinessData(businessId).floorItemCache[i]).amount} available`);
messagePlayerNormal(client, `${getInlineChatColourByName("yellow")}${toInteger(i)+1}: ${getInlineChatColourByName("white")}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name}${getInlineChatColourByName("lightGrey")}[${getItemValueDisplayForItem(getBusinessData(businessId).floorItemCache[i])}] - [${(getPlayerCurrentSubAccount(client).cash<getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? rgbToHex(205, 60, 60) : rgbToHex(50, 205, 50)}]$${getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice} [#CCCCCC] - ${getItemData(getBusinessData(businessId).floorItemCache[i]).amount} available`, COLOUR_WHITE);
//itemDisplay.push(`${getInlineChatColourByType("jobYellow")}${toInteger(i)+1}: ${getInlineChatColourByName("white")}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name}${getInlineChatColourByName("lightGrey")}${getItemValueDisplayForItem(getBusinessData(businessId).floorItemCache[i])} - [${(getPlayerCurrentSubAccount(client).cash<getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? rgbToHex(205, 60, 60) : rgbToHex(50, 205, 50)}]$${getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice} [#CCCCCC] - ${getItemData(getBusinessData(businessId).floorItemCache[i]).amount} available`);
messagePlayerNormal(client, `${getInlineChatColourByName("yellow")}${toInteger(i)+1}: ${getInlineChatColourByName("white")}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name}${getInlineChatColourByName("lightGrey")}${getItemValueDisplayForItem(getBusinessData(businessId).floorItemCache[i])} - [${(getPlayerCurrentSubAccount(client).cash<getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? rgbToHex(205, 60, 60) : rgbToHex(50, 205, 50)}]$${getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice} [#CCCCCC] - ${getItemData(getBusinessData(businessId).floorItemCache[i]).amount} available`, COLOUR_WHITE);
}
//messagePlayerNormal(client, splitItemDisplay[i].join("${getInlineChatColourByName("white")}, "), COLOUR_WHITE);
@@ -1523,7 +1531,7 @@ function showBusinessStorageInventoryToPlayer(client, businessId) {
if(getBusinessData(businessId).storageItemCache == -1) {
itemDisplay.push(`${getInlineChatColourByName("yellow")}${toInteger(i)+1}${getInlineChatColourByName("lightGrey")}(Empty)`);
} else {
itemDisplay.push(`${getInlineChatColourByName("yellow")}${toInteger(i)+1}: ${getInlineChatColourByName("white")}${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[i]).itemTypeIndex).name}${getInlineChatColourByName("lightGrey")}[${getItemValueDisplayForItem(getBusinessData(businessId).storageItemCache[i])}] - [#CCCCCC]${getItemData(getBusinessData(businessId).storageItemCache[i]).amount} available`);
itemDisplay.push(`${getInlineChatColourByName("yellow")}${toInteger(i)+1}: ${getInlineChatColourByName("white")}${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[i]).itemTypeIndex).name}${getInlineChatColourByName("lightGrey")}${getItemValueDisplayForItem(getBusinessData(businessId).storageItemCache[i])} - [#CCCCCC]${getItemData(getBusinessData(businessId).storageItemCache[i]).amount} available`);
}
}
@@ -1548,7 +1556,7 @@ function showItemInventoryToPlayer(client, itemId) {
if(getItemData(itemId).itemCache == -1) {
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}${getInlineChatColourByName("lightGrey")}(Empty)`);
} else {
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${getInlineChatColourByName("lightGrey")}${getItemTypeData(getItemData(getItemData(itemId).itemCache[i]).itemTypeIndex).name}[${getItemValueDisplayForItem(getItemData(itemId).itemCache[i])}]`);
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${getInlineChatColourByName("lightGrey")}${getItemTypeData(getItemData(getItemData(itemId).itemCache[i]).itemTypeIndex).name}${getItemValueDisplayForItem(getItemData(itemId).itemCache[i])}`);
}
}
@@ -1578,7 +1586,7 @@ function showPlayerInventoryToPlayer(client, targetClient) {
if(getPlayerData(targetClient).hotBarItems[i] == -1) {
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${colour}(Empty)`);
} else {
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${colour}${getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex).name}[${getItemValueDisplayForItem(getPlayerData(targetClient).hotBarItems[i])}]`);
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${colour}${getItemTypeData(getItemData(getPlayerData(targetClient).hotBarItems[i]).itemTypeIndex).name}${getItemValueDisplayForItem(getPlayerData(targetClient).hotBarItems[i])}`);
}
}
@@ -1608,7 +1616,7 @@ function showHouseInventoryToPlayer(client, houseId) {
if(getHouseData(houseId).itemCache == -1) {
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}${getInlineChatColourByName("lightGrey")}(Empty)`);
} else {
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${getInlineChatColourByName("lightGrey")}${getItemTypeData(getItemData(getHouseData(houseId).itemCache[i]).itemTypeIndex).name}[${getItemValueDisplayForItem(getBusinessData(houseId).itemCache[i])}]`);
itemDisplay.push(`[#CCCCCC]${toInteger(i)+1}: ${getInlineChatColourByName("lightGrey")}${getItemTypeData(getItemData(getHouseData(houseId).itemCache[i]).itemTypeIndex).name}${getItemValueDisplayForItem(getBusinessData(houseId).itemCache[i])}`);
}
}