Pivity

Keeping job on disconnect

Last read Never
#1

Hi, noob question I know but i don't think i'm looking at it correctly so come here for some support!


Basically i run a darkrp server and i need to be able to force everyone to keep their job on disconnect, is there a way to do this?


Thanks

#2

Moved to Lua Help

#3

You could store their current job in a database i think.

Agree x 1
#4

One way to accomplish this would be to store the players job on disconnect (there must be a hook for that I guess) - via database or text file and on player join, check the database and manually re-assign the job.

Only problem is with jobs that have player limits, this behaviour needs to be regulated, either don't reassign the job or ignore the limit.


pseudo code:


hook.Add( "PlayerDisconnect", "reassignjobs-disconnect", function()

store(player:job(), player:steamid())

end )


hook.Add( "PlayerJoin", "reassignjobs-join", function()

if player is in database then

player:reassignJob(database[player:steamid()])

end

end )

Informative x 1
Users viewing this thread
Nobody