SetPData / GetPData no working properly ?

Hello i’ve been having some troubles with PData because it’s simply not working on a listen server or a dedicated server…

For example:

hook.Add( "PlayerDisconnected", "PlDisctwo", function( pl )
    for _, v in pairs( player.GetAll() ) do
		if ( v:GetPData("ShowSid") == 1 ) then
				v:ChatPrint( pl:GetName().. ": " )

end )

hook.Add( "PlayerSay", "PlSaytwo", function (ply, msg, team)
	if msg == "!hidesid" then
		ply:ChatPrint( "Disabled ShowSid" )
	if msg == "!showsid" then
		ply:ChatPrint( "Enabled ShowSid" )
end )

Here i try to make script that shows a players SteamID when he leave to players that have typed “!showsid” in chat.
I used PData because i don’t want players to have to type the command everytime the server restarts or the map changes.

The script is running and i get no errors, appearently “v:GetPData(“ShowSid”) == 1” is returning as nil cause SetPData isn’t setting anything


GetPData returns a string. Typecast it to a number to compare it to 1, or enclose the 1 in ".

lol thanks i believe its working… kinda silly >.<