Selecting Weapons

Okay, I’m stumped as to what to do, here is the problem:

I’m making a new class selection panel, this time with the ability to select weapons instead of spawning with pre-defined weapons, but I don’t know how to make it so that when they click the button “Enter Battle” they spawn with the weapons they selected.

How should I go about making this possible?

I guess you could spawn people, Godmode them and bring up the menu.

Then first Menu; Heavy weapons (Colt, AK47, SMG - whatever ) Then when they press a button, let them recieve that weapon, close the Menu and open a new one, but with Pistols instead of Machine Guns and then close it and ungod them.

Not sure if this is what you want, but the best solution I can come up with.

No it’s not what I want, but thanks for trying.

Um…basically I’ve got specific classes, and when they click that classes button some text will appear saying “You will spawn as <class name>” and then theres the timer, which after counting down makes the button to let you spawn appear.

Now, the text which tells you what class you will spawn as will let me make it so when you choose individual classes you will have a different array of weapons available, say if you click medic, you will be able to select from a list of LMG’s, and if you select engineer you will be able to select from a list of SMG’s, and Assault will get Assault Rifles, and Recon will get snipers. But each class has its own specific set of guns, meaning it cannot choose guns that are meant for other classes.

I know it is hard to understand, but that is because it is hard to explain, but here is an example of what the Derma Menu should look like:

http://i47.tinypic.com/delj61.jpg%3C/a%3E
This was made in Derma Designer, the paint palette is supposed to represent where the DModelPanel would go.

I’m going to repost this thing in the “What do you need help with” thread to get some more responses

Use concommands to send it to the server.

[lua]
local mygun = “default”
local myothergun = “default”

PrimaryDropDown.OnSelect = function( dropdown, index, value, data ) mygun = value end
SecondaryDropDown.OnSelect = function( dropdown, index, value, data ) myothergun = value end

SpawnButton.DoClick = function()
RunConsoleCommand(“primary”, “mygun”)
RunConsoleCommand(“secondary”, “myothergun”)
end
[/lua]

Then on the server something like:

[lua]
concommand.Add(“primary”, function(ply, cmd, args)
ply.Weapons = ply.Weapons or {}
ply.Weapons[“primary”] = args[1]
end)

concommand.Add(“secondary”, function(ply, cmd, args)
ply.Weapons = ply.Weapons or {}
ply.Weapons[“secondary”] = args[1]
end)

hook.Add(“PlayerSpawn”, “UID”, function(ply)
if ply.Weapons then
ply:Give(ply.Weapons[“primary”] or “defaultprimary”)
ply:Give(ply.Weapons[“secondary”] or “defaultsecondary”)
else
ply:Give(“defaultprimary”)
ply:Give(“defaultsecondary”)
end
end)
[/lua]

I shall test when I get home, thankyou iRzilla :smiley: