• [TTT] Stored ammo (type and amount)
    3 replies, posted
How can I get AND set the stored ammo type and amount of a player's weapon? Thanks in advance!
You would have to store it upon disconnect into database using sqlite. Then on initialize or any other preferable hook, you can fetch it and apply to players.
Or, if you don't mean 'stored' as in database storing, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/GetPrimaryAmmoType]Weapon:GetPrimaryAmmoType[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/GetSecondaryAmmoType]Weapon:GetSecondaryAmmoType[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetAmmoCount]Player:GetAmmoCount[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/Clip1]Weapon:Clip1[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/Clip2]Weapon:Clip2[/url] [editline]26th March 2016[/editline] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetAmmo]Player:SetAmmo[/url]
[QUOTE=Netheous;50007099]You would have to store it upon disconnect into database using sqlite. Then on initialize or any other preferable hook, you can fetch it and apply to players.[/QUOTE] I forgot to explain exactly what I need, sry. (That's not what I needed) [QUOTE=MPan1;50007126]Or, if you don't mean 'stored' as in database storing, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/GetPrimaryAmmoType]Weapon:GetPrimaryAmmoType[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/GetSecondaryAmmoType]Weapon:GetSecondaryAmmoType[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetAmmoCount]Player:GetAmmoCount[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/Clip1]Weapon:Clip1[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Weapon/Clip2]Weapon:Clip2[/url] [editline]26th March 2016[/editline] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetAmmo]Player:SetAmmo[/url][/QUOTE] Exactly what I needed, thank you! Thank you both for your reply.
Sorry, you need to Log In to post a reply to this thread.