Basically, I need to know the primary weapon a player currently holds (GM is TTT).
I tried using ply:GetWeapons()[2], because it seemed like that's where the primary is located on the table, but it acted weird.
This is PrintTable of ply:GetWeapons() after picking up a weapon right after spawning -
[CODE]1 = Weapon [313][weapon_zm_improvised]
2 = Weapon [315][weapon_ttt_unarmed]
3 = Weapon [338][weapon_zm_carry]
4 = Weapon [908][weapon_zm_shotgun]
[/CODE]
This is PrintTable of ply:GetWeapons() after throwing a weapon and picking up a different one:
[CODE]1 = Weapon [313][weapon_zm_improvised]
2 = Weapon [927][weapon_ttt_m16]
3 = Weapon [338][weapon_zm_carry]
5 = Weapon [932][weapon_ttt_glock]
[/CODE]
Is there any way to retrieve a player's primary consistently?
[QUOTE=JasonMan34;49725455]I need to know the primary weapon a player currently holds[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetActiveWeapon]Player:GetActiveWeapon[/url]?
[QUOTE=MPan1;49725521][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/GetActiveWeapon]Player:GetActiveWeapon[/url]?[/QUOTE]
I don't want the weapon he's holding out, I want his primary weapon. The weapon in slot 3.
But I got it anyways, just gotta check for weapon.Kind
I should've looked a little more before making this :c
Sorry, you need to Log In to post a reply to this thread.