Well..
[CODE]ply:SetPData( "Save", ply:GetNWInt( "Money" )) [/CODE]
and then I use
[CODE]ply:SetNWInt( "Money", ply:GetPData( "Save" )) [/CODE]
but when I use it in Initial Spawn anything it dosent load... untill I just reload ingame. And it works perfectly?
Is there a way to make like a Data file and receive the players money when they join? and save it when they leave?
Thanks...
and I use GM:PlayerInitialSpawn( ply ) for receiving data and GM:ShutDown( ply ) & GM:PlayerDisconnect( ply ) for saving data...
Yeah... so is there a way to save a file to the Data file and receiving data??
Thanks - Jacob
[editline]14th August 2016[/editline]
So can someone help?
Try setting a timer.Simple(1, function() *code* end) arou,d the loading code.
You could alternatively just use SQL
[QUOTE=Klaes4Zaugen;50882957]Try setting a timer.Simple(1, function() *code* end) arou,d the loading code.
You could alternatively just use SQL[/QUOTE]
How may I use SQL?
[QUOTE=jacobcooper18;50883150]How may I use SQL?[/QUOTE]
There's SQLite which is basically a "built-in" SQL for Garry's Mod.
These are some documented functions and a decent (maybe a bit old) tutorial;
[url]https://wiki.garrysmod.com/page/Category:sql[/url]
[url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexb23a.html[/url]
There's also modules such as [URL="https://facepunch.com/showthread.php?t=1442438"]tMySQL[/URL] (personal fav) and [URL="https://facepunch.com/showthread.php?t=1515853"]MySQLOO[/URL] which allow you to use external databases which is great for multiple servers.
[QUOTE=kpjVideo;50883228]There's SQLite which is basically a "built-in" SQL for Garry's Mod.
These are some documented functions and a decent (maybe a bit old) tutorial;
[url]https://wiki.garrysmod.com/page/Category:sql[/url]
[url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexb23a.html[/url]
There's also modules such as [URL="https://facepunch.com/showthread.php?t=1442438"]tMySQL[/URL] (personal fav) and [URL="https://facepunch.com/showthread.php?t=1515853"]MySQLOO[/URL] which allow you to use external databases which is great for multiple servers.[/QUOTE]
How may I use the tMySQL in adding like my players money?
You shouldnt use tMySQL unless you plan to have multiple servers running the gamemode/addon
Sorry, you need to Log In to post a reply to this thread.