This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// zod schema | |
z.object({ | |
// valid if string or: | |
optional: z.string().optional(), // field not provided, or explicitly `undefined` | |
nullable: z.string().nullable(), // field explicitly `null` | |
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined` | |
}); | |
// type | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDlcWeaponData(dlcWeaponIndex) { | |
const buffer = new alt.MemoryBuffer(312); | |
game.getDlcWeaponData(dlcWeaponIndex, buffer); | |
const data = [ | |
buffer.int(0), // int emptyCheck; //use DLC1::_IS_DLC_DATA_EMPTY on this | |
buffer.int(8), // int weaponHash; | |
buffer.int(16), // int unk; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"62870901": { | |
"HashKey": "WEAPON_SNOWLAUNCHER", | |
"NameGXT": "WT_SNOWLNCHR", | |
"DescriptionGXT": "WTD_SNOWLNCHR", | |
"Name": "Snowball Launcher", | |
"Description": "There's no greater gift than pummeling someone with rounds of festive cheer. With automatic reload, there's no time for anyone to disagree. Part of The Chop Shop.", | |
"Group": "GROUP_HEAVY", | |
"ModelHashKey": "W_LR_CompactSL_M32", | |
"DefaultClipSize": 20, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (string) => { | |
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase(); | |
}; |