Has anyone been successful with the code example form the Wiki?
I created a package with that code example and it doesn't seem to work. If I don't add a parameter correctly, the AddPlayerChat fires to let me know, but if I add parameters correctly, nothing happens. I'm not sure if this is due to the code example not working, or if it's because I need to have something configured on the server in order for weapons to work.
This is the code example from the wiki:
I created a package with that code example and it doesn't seem to work. If I don't add a parameter correctly, the AddPlayerChat fires to let me know, but if I add parameters correctly, nothing happens. I'm not sure if this is due to the code example not working, or if it's because I need to have something configured on the server in order for weapons to work.
This is the code example from the wiki:
Code:
function cmd_w(player, weapon, slot, ammo) if (weapon == nil or slot == nil or ammo == nil) then return AddPlayerChat(player, "Usage: /w <weapon> <slot> <ammo>") end SetPlayerWeapon(player, weapon, ammo, true, slot, true) end AddCommand("w", cmd_w) AddCommand("weapon", cmd_w)
Comment