[Essential-Mode] Expend users metatable


#1

I would like to expend the metatable of “Users” in Essential-Mode :

player.lua

login.lua

but i’ve an error (error executing handler es:getPlayerFromId …
Any help ?


#2

up … Anyone has the solution ? :confused:


#3

No need to actually do it like this, essential-mode supports this:

player:setSessionVar('key', value)

and then use

player:getSessionVar('key')

to retrieve it.

So for jobs,

player:setSessionVar('job', 'police') -- Set it
player:getSessionVar('job') -- Get it

#5

Is this for client side? And it automatically reset when the player disconnecting from the server ?


#6

this interact with database ? cause i added “job” un users table so i would like to get it simply (like we can get money by example “user.money” i want the same for job “user.job”)