Is it possible to do this? If so can someone explain it to me, i know you would have to obviously use [CODE]Ply:GetWeapons[/CODE] But i dont know anything other then that, I read the tut on the gmodwiki about the SQL lite and it looks like it can only be used to store values, I was thinking of useing file.Write and file.read but i have not the slightest clue of how to use it with getweapons
The weapon itself, you don't have to store it, that would be pointless. Once you get the table containing the player's weapons, simply save it on the file using util.TableToKeyValues to get the table on a string, then, when you load it back, use util.KeyValuesToTable, loop through the table, and do ply:Give( value ).
For saving weapons it's generally better to use the SQL database rather than a collection of files; after all this sort of thing is what the SQL support was made for.
I suppose what I'd do is have a table on the DB with the weapon classname and the owner's SteamID. Unless there's some special variable in the SWEP you want to save, and you just want to save what weapons the player has to the database, all you need to do is store the classname of the weapon.
[QUOTE=MegaJohnny;19598735]For saving weapons it's generally better to use the SQL database rather than a collection of files; after all this sort of thing is what the SQL support was made for.
I suppose what I'd do is have a table the weapon classname and the owner's SteamID. Unless there's some special variable in the SWEP you want to save, and you just want to save what weapons the player has to the database, all you need to do is store the classname of the weapon.[/QUOTE]
I did this in a simple npc some time ago.
Sorry, you need to Log In to post a reply to this thread.