Personal Lockers
Commands, Exports & Events
Every command, export and event of Personal Lockers, with what to pass, what you get back and an example.
Everything other resources can use to work with Personal Lockers: chat commands, exports you can call from your own scripts, and events you can listen to or trigger.
Commands
/adminlockers
Opens the admin menu: find lockers, open them, change levels.
Arguments
None.
Who can use it
Admins
/openlocker
Opens a player's locker for you.
Arguments
idnumber | stringServer id of an online player, or a citizen id.
Who can use it
Admins
/clearlocker
Deletes every item in a locker.
Arguments
idnumber | stringServer id or citizen id.
Who can use it
Admins
/setlockerlevel
Changes a locker's level (size).
Arguments
idnumber | stringServer id or citizen id.
levelnumberA level from
Config.Levels.
Who can use it
Admins
Server exports
GetLockerLevel
Reads a character's locker level.
What you pass
citizenIdstringCharacter identifier.
What you get back
levelnumberCurrent level;
1when they have no locker yet.
Example
local level = exports.lg_lockers:GetLockerLevel(citizenId)SetLockerLevel
Sets a character's locker level and resizes the stash right away.
What you pass
citizenIdstringCharacter identifier.
levelnumberA level that exists in
Config.Levels.
What you get back
successbooleanfalsewhen that level does not exist.
Example
exports.lg_lockers:SetLockerLevel(citizenId, 3)GetStashId
Returns the inventory stash id of a character's locker, for use with your inventory's own exports.
What you pass
citizenIdstringCharacter identifier.
What you get back
stashIdstringConfig.Stash.Prefixfollowed by the citizen id.
Example
local stashId = exports.lg_lockers:GetStashId(citizenId)OpenLocker
Opens a locker for a player: their own, or someone else's when you pass a citizen id (e.g. for a police search).
What you pass
sourcenumberServer id of the player who will see the locker.
citizenIdstringoptionalWhose locker to open. Leave it out to open the player's own.
What you get back
openedbooleanfalsewhen the player is not loaded.
Example
exports.lg_lockers:OpenLocker(source) -- their own locker
exports.lg_lockers:OpenLocker(source, suspectCid) -- someone else'sClearLocker
Deletes every item in a character's locker.
What you pass
citizenIdstringCharacter identifier.
What you get back
successbooleanfalsewhen that character has no locker.
Example
exports.lg_lockers:ClearLocker(citizenId)Client exports
OpenMenu
Opens the locker menu for the local player. The distance to a locker location is still checked on the server.
What you pass
Nothing.
What you get back
Nothing.
Example
exports.lg_lockers:OpenMenu()Events
lg_lockers:server:upgraded
Fired after a player buys a locker upgrade.
What you receive
sourcenumberServer id of the player.
citizenIdstringTheir identifier.
newLevelnumberThe level they upgraded to.
Example
AddEventHandler('lg_lockers:server:upgraded', function(source, citizenId, newLevel)
print(citizenId .. ' upgraded to level ' .. newLevel)
end)lg_lockers:client:openMenu
Opens the locker menu (distance still checked on the server). Trigger it from the server.
What you send
No data.
Example
TriggerClientEvent('lg_lockers:client:openMenu', source)Last updated