The MrNewb Name Changer script introduces a convenient item that, when used, triggers an input menu, allowing players to seamlessly modify their character's first and last names. Upon submission, the item is automatically removed, and the changes are reflected in both the character info and metadata for the QBCore and QBx_Core frameworks. This feature empowers players to update their names without the hassle of a relog.
- User-Friendly Interface: Utilizes OxLib input for a smooth and intuitive name-changing experience.
- Framework Compatibility: Compatible with both QBCore and QBx_Core frameworks.
- Automatic Item Removal: Ensures the seamless removal of the item upon successful name change.
- No Relog Required: Allows players to see the changes in real-time without the need for a relog.
- Acquire the Name Changer item: Configure the item in your inventory (Example item configuration for QBCore provided below).
- Use the item: Trigger the OxLib input to modify your character's first and last names.
- Enter desired names: Input the desired first and last names and submit the changes.
- Automatic Removal: The item is automatically removed, and your character's name is instantly updated in character info and metadata.
- OxLib: OxLib is a optional dependency, if not using it remove it from the manifest and set the config value.
- Dirk: Script concept and encouragement to create my version. (DirkScripts)
- Blue: Feedback on using an item for name changes (originally command-based)(Blue)
- Kamui Kody: Provided the charInfo table. (Kody)
- Pickle: Emotional support. (PickleModifications)
- OnlyCure & mr.olson: Testing assistance.
This script was developed to address the need for immediate name changes without requiring a relog. The item approach was chosen for its simplicity and user-friendly interface.
If you intend to use the QB logs from qb-smallresources, it's necessary to set up your own webhook. You can find the webhook creation in the logs.lua file at the following location:
Make sure to name the webhook as "namechangelog"
['namechangevoucher'] = {['name'] = 'namechangevoucher', ['label'] = 'namechangevoucher', ['weight'] = 200, ['type'] = 'item', ['image'] = 'namechangevoucher.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['blankmarriagecertificate'] = {['name'] = 'blankmarriagecertificate', ['label'] = 'blankmarriagecertificate', ['weight'] = 200, ['type'] = 'item', ['image'] = 'blankmarriagecertificate.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
['filledcertificate'] = {['name'] = 'filledcertificate', ['label'] = 'filledcertificate', ['weight'] = 200, ['type'] = 'item', ['image'] = 'filledcertificate.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
--Weird new qb item format just in case you are on that version/not on qbx
namechangevoucher = {name = 'namechangevoucher', label = 'namechangevoucher', weight = 200, type = 'item', image = 'namechangevoucher.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = ''},
blankmarriagecertificate = {name = 'blankmarriagecertificate', label = 'blankmarriagecertificate', weight = 200, type = 'item', image = 'blankmarriagecertificate.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = ''},
filledcertificate = {name = 'filledcertificate', label = 'filledcertificate', weight = 200, type = 'item', image = 'filledcertificate.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = ''},
On line 362 of qb-inventory, add the following line:
case "filledcertificate":
return `<p><strong>First Name: </strong><span>${itemData.info.firstname}</span></p>
<p><strong>Last Name: </strong><span>${itemData.info.lastname}</span></p>`;
On line 647 of ps-inventory, add the following line:
} else if (itemData.name == "filledcertificate") {
$(".item-info-title").html("<p>" + itemLabel + "</p>");
$(".item-info-description").html(
"<p><strong>First Name: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Last Name: </strong><span>" +
itemData.info.lastname +
"</span></p>"
);
}
Special thanks to Decay Studios for creating the inventory icons used in this release. You can find them on Discord here.