Pivity

In-Game Config file

Last read Never
#1

So I made a thread for a bunch of suggestions, one of which was an In-game config, so I added all the UI, and now down to the coding.

I'm super confused on how I should approach this. In my config I have a table for all of my weapons in the store:

PSweps.Weapons = {
{"models/swamponions/vape.mdl", "Normal Vape", "weapon_vape", 500000},
{"models/swamponions/vape.mdl", "Juicy Vape", "weapon_vape_juicy", 500000},
{"models/weapons/w_csgo_bayonet.mdl", "Bayonet | Tiger Tooth", "csgo_bayonet_tiger", 1500000},
{"models/weapons/w_csgo_bowie.mdl", "Bowie Knife | Fade", "csgo_bowie_fade", 1000000},
{"models/weapons/w_csgo_bowie.mdl", "Bowie Knife | Crimson Web", "csgo_bowie_crimsonwebs", 500000},
{"models/weapons/w_csgo_bowie.mdl", "Bowie Knife | Tiger Tooth", "csgo_bowie_tiger", 500000},
{"models/weapons/w_csgo_bayonet.mdl", "Bayonet | Tiger Tooth", "csgo_bayonet_tiger", 1500000},
{"models/weapons/w_csgo_butterfly.mdl", "Butterfly Knife | Fade", "csgo_butterfly_fade",1000000},
}

Now, I was thinking, if I were to write this table to a json on initialization and when they click save on the UI to add a new weapon, then I just read it in the config file and then store it in the PSweps.weapons table it'd be fine, but then how could I do this since I'd need dummy data but how would I do this without it creating it everytime the script initialized.

What would be the best approach into adding to a dictionary in a whole different file & saving it.

Users viewing this thread
Nobody