DarkRP trouble (Unassigned players, no money bug etc.)

Ever since the latest Gmod update, DarkRP on my server seems to be slightly messed up. Let me try to explain. It works absolutely perfectly for most people, but for around 10% of the server (seems to be a random selection), they spawn as “Unassigned” (their job name) players - grey statues that hover around the place. If you are selected to be “Unassigned”, you will have no money in your wallet, you will not be able to use any commands, but you can operate normally - spawning props, shooting, phsygunning all works fine. I’ve reinstalled DarkRP several times but no luck. Obviously my first thought would be that the DarkRP database is somehow affected, but I have no experience with it, or indeed even know how to access it. Help would be much appreciated, and I can supply any more info that you might need!

Sorry if this is in the wrong section, I looked around and thought that this would be the best place.

Screenshot of an “Unassigned” player:

http://dl.dropbox.com/u/17323013/gm_construct0010.jpg

Re-install your server, the fastest and almost best thing to do.

Something is wrong with your jobs. Check the shared.lua files for errors. It is most likely that, which is causing it.

You must have made some changes in it; go through the changes.

That was my first thought too. It can’t be that, though, because I run a second server also, and both of them use the exact same addentities.lua and shared.lua files. The second server’s gamemode works perfectly - no problems whatsoever. But this one doesn’t, even though I’ve searched both lua files several times to look for errors. :frowning:
Thanks for the ideas though! Do you know how I can save the DarkRP “data” (wallet file, so I can save people’s cash), if I want to do a complete reinstall (which is definitely a last resort!)?

The money is saved in the sv.db file.

If I re-install the server, I can just keep this file and replace it? That’s all there is to it?

Yea, all darkrp shit you want saved is located inside sv.db.

Don’t reinstall the server. It’s probably just a typo.

That’s what I thought too, but I’ve never touched anything other than the shared.lua and addentities.lua files in DarkRP, and those two files are copied from my other server’s DarkRP gamemode folder, which works absolutely perfectly. I don’t understand what has happened to it. :frowning:

Try copying it again, and see if you came to press any button when you saved it or something.

If you reinstall your server your database wont be backed up as long as you are using sqlite unless done manually.

Reinstalling your wont server wont even fix it, you need to fix the code and its not the shared.lua, the player is remaining on the spectator team and not getting set citizen by default.

Copied them over again without even opening them up, and it still is bugged. I don’t understand what could possibly cause it, as I don’t recall opening any other file in DarkRP other than those two.

zzaacckk if it’s not shared.lua, what would you say it is? (I’m not trying to be smart as it might appear over the internet, I genuinely want to know). I’m sort of desperate at this point.

DarkRP is not setting the players team from spectator/connecting to the citizen team.

I would add this code to init.lua

[lua]
hook.Add(“PlayerInitialSpawn”,“SetCitizen”,function(ply)
if not ply:Team() == TEAM_CITIZEN then ply:SetTeam(TEAM_CITIZEN) end
end)
[/lua]

See if that works :slight_smile:

Cheers mate, that’ll fix the team problem but those who spawn as Unassigned also cannot use commands or have any money stored in their wallets. They also cannot pick up money either.
Thanks for the code, at least it’ll fix a bit of the problem :slight_smile:

Forcing someone’s team won’t solve a database issue…

When did this become a database issue?

When their money won’t load/save, and they can’t pick up any.

[editline]27th February 2011[/editline]

@OP is your server using MySQL?

Its not a database issue.

Its a issue of them being unconnected and their information not loading.

You really have no idea what you’re talking about, do you? Their information isn’t being loaded because it CAN’T be loaded. Usually because with MySQL, the server disconnects, or it “goes away”.

The default team has no interaction with the mysql database, so if they arent a citizen then there must be another error also causing their team not to be a citizen.