Use more locale strings
This commit is contained in:
@@ -296,24 +296,26 @@ function pickupItemCommand(command, params, client) {
|
||||
|
||||
if (!getItemData(itemId)) {
|
||||
//messagePlayerError(client, `The item you're trying to pick up is bugged. A bug report has been sent to the server developers.`);
|
||||
messagePlayerError(client, getPlayerLocale(client, "NoItemCloseEnough"));
|
||||
submitBugReport(client, `(AUTOMATED REPORT) Pickup Item: Getting item data for item ${itemId} on ground returned false.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
||||
//messagePlayerError(client, `The item you're trying to pick up is bugged. A bug report has been sent to the server developers.`);
|
||||
messagePlayerError(client, getPlayerLocale(client, "NoItemCloseEnough"));
|
||||
submitBugReport(client, `(AUTOMATED REPORT) Pickup Item: Getting item type ${getItemData(itemId).itemType} data for item ${itemId}/${getItemData(itemId).databaseId} on ground returned false.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getDistance(getPlayerPosition(client), getItemData(itemId).position) > getGlobalConfig().droppedItemPickupRange) {
|
||||
messagePlayerError(client, `You're too far away!`);
|
||||
messagePlayerError(client, getPlayerLocale(client, "NoItemCloseEnough"));
|
||||
return false;
|
||||
}
|
||||
|
||||
let firstSlot = getPlayerFirstEmptyHotBarSlot(client);
|
||||
if (firstSlot == -1) {
|
||||
messagePlayerError(client, `You don't have any space to carry this (full inventory)!`);
|
||||
messagePlayerError(client, getPlayerLocale(client, "NoSpaceSelfInventory"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -359,25 +361,25 @@ function dropItemCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (hotBarSlot == -1) {
|
||||
messagePlayerError(client, `You don't have any item selected/equipped.`);
|
||||
messagePlayerError(client, getLocaleString(client, "NoItemEquipped"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getPlayerData(client).hotBarItems[hotBarSlot] == -1) {
|
||||
messagePlayerError(client, `You don't have an item in your active slot.`);
|
||||
messagePlayerError(client, getLocaleString(client, "NoItemInActiveSlot"));
|
||||
return false;
|
||||
}
|
||||
|
||||
let itemId = getPlayerData(client).hotBarItems[hotBarSlot];
|
||||
|
||||
if (!getItemData(itemId)) {
|
||||
messagePlayerError(client, `The item you're trying to drop is bugged. A bug report has been sent to the server developers.`);
|
||||
messagePlayerError(client, getLocaleString(client, "DropItemBugged"));
|
||||
submitBugReport(client, `(AUTOMATED REPORT) Drop Item: Getting item data for item ${itemId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getItemTypeData(getItemData(itemId).itemTypeIndex)) {
|
||||
messagePlayerError(client, `The item you're trying to drop is bugged. A bug report has been sent to the server developers.`);
|
||||
messagePlayerError(client, getLocaleString(client, "DropItemBugged"));
|
||||
submitBugReport(client, `(AUTOMATED REPORT) Drop Item: Getting item type ${getItemData(itemId).itemType} data for item ${itemId}/${getItemData(itemId).databaseId} in player hotbar slot ${hotBarSlot} (cache ${getPlayerData(client).hotBarItems[hotBarSlot]}) returned false.`);
|
||||
return false;
|
||||
}
|
||||
@@ -393,7 +395,7 @@ function dropItemCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (isPlayerItemFromJobEquipment(client, hotBarSlot)) {
|
||||
messagePlayerError(client, `You can't drop job items`);
|
||||
messagePlayerError(client, getLocaleString(client, "CantDropJobEquipmentItem"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -449,7 +451,7 @@ function putItemCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (isPlayerItemFromJobEquipment(client, hotBarSlot)) {
|
||||
messagePlayerError(client, `You can't put job items`);
|
||||
messagePlayerError(client, getLocaleString(client, "CantPutJobEquipmentItem"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -480,7 +482,7 @@ function takeItemCommand(command, params, client) {
|
||||
|
||||
let firstSlot = getPlayerFirstEmptyHotBarSlot(client);
|
||||
if (firstSlot == -1) {
|
||||
messagePlayerError(client, `You don't have any space to hold another item (full inventory)!`);
|
||||
messagePlayerError(client, getLocaleString(client, "NoSpaceSelfInventory"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -490,7 +492,7 @@ function takeItemCommand(command, params, client) {
|
||||
let itemId = bestOwner[2];
|
||||
|
||||
if (bestOwner[1] == VRR_ITEM_OWNER_NONE) {
|
||||
messagePlayerError(client, `You aren't near anything to take items from!`);
|
||||
messagePlayerError(client, getLocaleString(client, "NothingToTakeItemFrom"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -758,12 +760,16 @@ function playerUseItem(client, hotBarSlot) {
|
||||
}
|
||||
}
|
||||
}
|
||||
messagePlayerError(client, `You don't have any ammo to load into your ${itemTypeData.name}!`);
|
||||
messagePlayerError(client, getLocaleString(client, "NoAmmoToLoadIntoWeapon", itemTypeData.name));
|
||||
break;
|
||||
}
|
||||
|
||||
case VRR_ITEM_USETYPE_AMMO_CLIP: {
|
||||
messagePlayerError(client, `To load this ammo into a weapon, equip the weapon and ${(doesPlayerHaveKeyBindForCommand(client, "use")) ? `press {ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "use").key))}` : `{ALTCOLOUR}/use`}`);
|
||||
if (doesPlayerHaveKeyBindForCommand(client, "use")) {
|
||||
messagePlayerError(client, getLocaleString(client, "LoadAmmoIntoWeaponHelpKeyPress", `{ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "use").key))}{MAINCOLOUR}`));
|
||||
} else {
|
||||
messagePlayerError(client, getLocaleString(client, "LoadAmmoIntoWeaponHelpCommand", `{ALTCOLOUR}/use{MAINCOLOUR}`));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -806,17 +812,17 @@ function playerUseItem(client, hotBarSlot) {
|
||||
let closestPlayer = getClosestPlayer(getPlayerPosition(client), client);
|
||||
|
||||
if (!getPlayerData(closestPlayer)) {
|
||||
messagePlayerError(client, "There isn't anyone close enough to tie up!");
|
||||
messagePlayerError(client, getLocaleString(client, "NobodyCloseEnoughToTie"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getDistance(getPlayerPosition(closestPlayer), getPlayerPosition(client)) > getGlobalConfig().handcuffPlayerDistance) {
|
||||
messagePlayerError(client, "There isn't anyone close enough to tie up!");
|
||||
messagePlayerError(client, getLocaleString(client, "NobodyCloseEnoughToTie"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isPlayerSurrendered(closestPlayer)) {
|
||||
messagePlayerError(client, `${getCharacterFullName(closestPlayer)} can't be tied! They either need to have their hands up, be knocked out, or tazed`);
|
||||
messagePlayerError(client, getLocaleString(client, "PlayerNotSurrenderedTie", getCharacterFullName(closestPlayer)));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -839,12 +845,12 @@ function playerUseItem(client, hotBarSlot) {
|
||||
let closestPlayer = getClosestPlayer(getPlayerPosition(client), client);
|
||||
|
||||
if (!getPlayerData(closestPlayer)) {
|
||||
messagePlayerError(client, "There isn't anyone close enough to handcuff!");
|
||||
messagePlayerError(client, getLocaleString(client, "NobodyCloseEnoughToHandcuff"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getDistance(getPlayerPosition(closestPlayer), getPlayerPosition(client)) > getGlobalConfig().handcuffPlayerDistance) {
|
||||
messagePlayerError(client, "There isn't anyone close enough to handcuff!");
|
||||
messagePlayerError(client, getLocaleString(client, "NobodyCloseEnoughToHandcuff"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -853,7 +859,7 @@ function playerUseItem(client, hotBarSlot) {
|
||||
meActionToNearbyPlayers(client, `takes their key and removes the handcuffs from ${getCharacterFullName(closestPlayer)}`);
|
||||
} else {
|
||||
if (!isPlayerSurrendered(closestPlayer)) {
|
||||
messagePlayerError(client, `${getCharacterFullName(closestPlayer)} can't be cuffed! They either need to have their hands up, be knocked out, or tazed`);
|
||||
messagePlayerError(client, getLocaleString(client, "PlayerNotSurrenderedHandcuffed", getCharacterFullName(closestPlayer)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user