• When people join the server to keep their previous job.
    4 replies, posted
Hey, what can I do when a player has been to the server to spawn with his job, instead of picking F4 Jobs all over again. Please help, thank you :)
On disconnect, save his current job into pdata and on initialspawn set his job to that? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetPData]Player:SetPData[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetPData]Player:GetPData[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerInitialSpawn]GM:PlayerInitialSpawn[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDisconnected]GM:PlayerDisconnected[/url] edit: This is also to change the job in DarkRP I guess: [url]http://wiki.darkrp.com/index.php/Functions/Player/Server/changeTeam[/url] Also, wrong section belongs in [URL="https://facepunch.com/forums/65"]Developer Discussion[/URL]
[QUOTE=Mrkrabz;51043426]On disconnect, save his current job into pdata and on initialspawn set his job to that? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetPData]Player:SetPData[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetPData]Player:GetPData[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerInitialSpawn]GM:PlayerInitialSpawn[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDisconnected]GM:PlayerDisconnected[/url] edit: This is also to change the job in DarkRP I guess: [url]http://wiki.darkrp.com/index.php/Functions/Player/Server/changeTeam[/url] Also, wrong section belongs in [URL="https://facepunch.com/forums/65"]Developer Discussion[/URL][/QUOTE] Yes, that's what I'm searching!
And btw where do you put the function?
I'm guessing you'd put the hook and corresponding function in the DarkRP modules folder.
Sorry, you need to Log In to post a reply to this thread.