I have figured out why players appear as nil in DarkRP. It is because as soon as some one initially spawns DarkRP makes it so that their name is nil, then it sets their name to their DarkRP name. I have tried making a fix but I can not get it working, and by cant get it working I mean, it works with no errors, but instead of acctually putting your name in it makes more nils, who are pretty much you, so then you have a whole cluster of you's in your XGUI. And thats not what I want it to do if any one can help me get some sort of code working, I am sure that every one will be thankful.
function unilUserFix( ply )
timer.Create( "PlySpawnRankT_" .. ply:UserID(), 1.5, 1, ULib.ucl.addUser( ply:UniqueID(), nil, nil, ply:GetUserGroup() ) )
end
hook.Add( "PlayerInitialSpawn", "UlxNilUserFix", nilUserFix )
---
I have made some modifications, and it seems like it works, except that it breaks some client side parts of the XGUI. ( I would love if some one could help me with this. )
function unilUserFix( ply )
timer.Create( "PlySpawnRankT_" .. ply:UserID(), 2.5, 1, ULib.ucl.addUser( ply:UniqueID(), nil, nil, ply:GetUserGroup() ) )
timer.Create( "PlySpawnRankTr_" .. ply:UserID(), 3, 1, ULib.ucl.removeUser( ply:UniqueID() ) )
timer.Create( "PlySpawnRankTm_" .. ply:UserID(), 3.5, 1, ply:PrintMessage( HUD_PRINTTALK, "Hello, " .. ply:GetUserGroup() .. " " .. ply:Name() ) )
end
hook.Add( "PlayerSpawn", "UlxNilUserFix", unilUserFix )
I am adding then removing the same user because for some reason, the first one creates a duplicate, removing them seems to fix the problem while not removing them from their rank. The problem, is that doing the add and remove seems to break the client side part of the XGUI. So I don't think that will work out.
Should I make the wait interval between the timers bigger?