Just wondering if anyone could point me in the right direction. In terms of setting player loadouts for each individual person, not related to their group. How is this done, via a mysql database?
No need to use a database unless you plan on having extremely large amounts of player loadouts stored
[lua]
if SERVER then
util.AddNetworkString("TTTDonatorWeapons")
function WeaponStart( ply )
if ply:Team() == 1 then
if ply:SteamID()=="STEAM ID" then
ply:Give("weapon")
ply:GiveAmmo("number","type")
end
end
end
hook.Add("PlayerSpawn", "WeaponStart", WeaponStart )
[/lua]
[QUOTE=capnsparrow;41817160]No need to use a database unless you plan on having extremely large amounts of player loadouts stored
[/QUOTE]
There is a use for having it stored on SQL. For example, web programming use.
Why are you doing an if check for CLIENT? It's not needed.
I'm not really sure why that's in there actually, lol
[editline]12th August 2013[/editline]
Ok I do see your point now. I'm not terribly familiar with using SQL databases in Gmod but presumably you could store the weapon and ammo entity names in the database organized by player and just have it retrieve the right one for the code I gave and then I guess you would be able to edit the database outside of gmod if you want.
[QUOTE=capnsparrow;41817527]I'm not really sure why that's in there actually, lol
[editline]12th August 2013[/editline]
Ok I do see your point now. I'm not terribly familiar with using SQL databases in Gmod but presumably you could store the weapon and ammo entity names in the database organized by player and just have it retrieve the right one for the code I gave and then I guess you would be able to edit the database outside of gmod if you want.[/QUOTE]
By web programming use, I mean if he has knowledge of php/html etc; he could make an online editor where you could edit your loadout without being ingame.
Sorry, you need to Log In to post a reply to this thread.