ULX

Poll

Was this module useful, and helpful?

Yes :)
59 (93.7%)
No :(
4 (6.3%)

Total Members Voted: 63

Author Topic: Give Weapon Addon [1.08v]  (Read 31687 times)

0 Members and 1 Guest are viewing this topic.

Offline RDGXTECHX

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Give Weapon Addon
« Reply #30 on: December 04, 2014, 03:03:54 AM »
When you go to the admin tab of the pointshop, you'll be able to give the weapon to the player and then it becomes permanent for them. You would have to set yourself as admin and give yourself the weapons from that tab. That's what I was talking about because there's multiple options like in this photo

http://i.imgur.com/zpyjyF5.jpg


I wanted an option in that section that would be similar to the "give item" button but it would say something like "All Weapons" and the button would only show if the person matched a specific group or if they were an admin.


For example: If I was in a group called Platinum, and I asked an admin for my weapons, they would go to the "admin" tab, click the player's name and right below "take weapon," there would be a button "All Weapons [Platinum]." The same thing would show up if an admin was giving weapons to himself or another admin.


But if I wasn't in that group and I asked an admin, it wouldn't show up because I didn't match the prerequisites. I would like to be able to change these settings though whenever I wanted to. I can do that part in notepad++, I would just need an explanation of the values and the setup to stay consistent with the code.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Give Weapon Addon
« Reply #31 on: December 05, 2014, 08:46:07 PM »
For example: If I was in a group called Platinum, and I asked an admin for my weapons, they would go to the "admin" tab, click the player's name and right below "take weapon," there would be a button "All Weapons [Platinum]." The same thing would show up if an admin was giving weapons to himself or another admin.


But if I wasn't in that group and I asked an admin, it wouldn't show up because I didn't match the prerequisites. I would like to be able to change these settings though whenever I wanted to. I can do that part in notepad++, I would just need an explanation of the values and the setup to stay consistent with the code.

What you're asking for isn't really similar to your original post. This requires more information, and well a lot more time than I have to do this. You're pretty much asking for a complete makeover on this addon, that is well above my paygrade as well as I'm not the original creator of this addon, so I don't and can't think like him (as well as I have issues looking at other peoples code{I think other people code look too messy and hard to read}). As said previously, I could make a very simple command to remove weapons on players database.

Edit:
After further investigation on this addon, I decided that I'm not going to be able to touch this at all. Because the person who made this decided to make it really complex and complicated database speaking. Instead of a thing called "line separation", he just puts everything in there, and I don't feel like breaking things down in a table, just to remove weapons.. Sorry. On the other hand, it could be really easy and I'm just being lazy.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline RDGXTECHX

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Give Weapon Addon
« Reply #32 on: December 12, 2014, 04:00:26 PM »
Sorry for the late reply, are you still able to do an add all weapons feature and not the remove all? Or you can't do either because the code is complicated?

If it is possible, but you're unable to do it, could point me in the right direction for setting it up? I've had some experience with databases and some experience with lua. So by table you mean that you need to list out every weapon to be added/removed with that button? Or is there an easier way to read what weapons are in the pointshop and then give them to the player. Then read what's in the database and remove those from the player?

If it helps at all, the sql version is on on this post (no information is on it obviously).
« Last Edit: December 13, 2014, 12:15:55 PM by RDGXTECHX »

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Give Weapon Addon
« Reply #33 on: December 13, 2014, 04:20:59 PM »
I'm having an issue with this, it doesn't appear to save my weapons, as it strictly says "One Time Use, and I'll need to buy the weapon again". So I don't really understand exactly understand how your server stores these weapons for the players?

I didn't read the entire wall of text, so forgive me if I'm giving useless info.

There kind of is a way to do what RDGXTECHX wants, but it's a little messy.
You use a weapon item included in the pointshop download as a base and modify it to your liking.

From then, you will be using PS functions, viewable here: http://pointshop.burt0n.net/items/functions

You need something along the lines of:
Code: Lua
  1. function ITEM:OnBuy( ply )
  2.     -- This can be blank.
  3. end
  4.  
  5. function ITEM:OnEquip( ply )
  6.     RunConsoleCommand( "ulx", "give", ply:Nick(), self.WeaponClass )
  7. end
Out of the Garry's Mod business.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Give Weapon Addon
« Reply #34 on: February 03, 2015, 11:25:27 PM »
Updated addon to current system!
« Last Edit: February 03, 2015, 11:40:36 PM by Bite That Apple »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Max

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
TTT weapon code
« Reply #35 on: March 24, 2015, 02:46:24 PM »
i have the trouble in terrorist town weapon code if anyone needs it:

weapon_357 = Rifle
weapon_smg1 = Mac10
weapon_ar2 = M16
weapon_crossbow = Pistol
weapon_crowbar = incendiary grenade
weapon_frag = Deagle
weapon_rpg = HUGE
weapon_shotgun = Shotgun
weapon_smg1 = Mac10

Still don't know what the Discombobulator is so if anyone knows i hope you'll tell me.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Give Weapon Addon [1.07v]
« Reply #36 on: March 25, 2015, 02:18:07 AM »
Still don't know what the Discombobulator is so if anyone knows i hope you'll tell me.

Pretty sure the discombobulator would be weapon_ttt_confgrenade.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline allofmywutsteam

  • Full Member
  • ***
  • Posts: 136
  • Karma: 3
  • MNWO Owner
    • MNWO Discord
Re: Give Weapon Addon [1.07v]
« Reply #37 on: March 25, 2015, 08:30:20 AM »
Pretty sure the discombobulator would be weapon_ttt_confgrenade.

Considering I use name for a weapon loadout menu, figured I'd chime in.

Here's a list of weapon names in TTT. I've never tried in other game modes, but I would imagine you could remove ttt from the name, but don't quote me on it.
http://pastebin.com/8Gr2vN3D
"Then Jesus said to his disciples, 'Whoever wants to be my disciple must deny themselves and take up their cross and follow me.'" - Matthew 16:24



MNWO: Steam | Discord | Website | Join Server

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Give Weapon Addon [1.07v]
« Reply #38 on: March 25, 2015, 09:21:26 AM »
Do you guys want me to get the name of the weapon instead of the script name of it, I can do that, I just felt the script name was better?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline allofmywutsteam

  • Full Member
  • ***
  • Posts: 136
  • Karma: 3
  • MNWO Owner
    • MNWO Discord
Re: Give Weapon Addon [1.07v]
« Reply #39 on: March 25, 2015, 10:11:43 AM »
Do you guys want me to get the name of the weapon instead of the script name of it, I can do that, I just felt the script name was better?

I feel it would be easier to read the wep name rather than the script name (wtester would be an example), so that would help. Now I'm assuming this would be for a dropdown menu correct? So you'd be converting the script name, and making it gui friendly with a wep name. Right?

I don't have this addon added, but I plan on installing it tonight.
"Then Jesus said to his disciples, 'Whoever wants to be my disciple must deny themselves and take up their cross and follow me.'" - Matthew 16:24



MNWO: Steam | Discord | Website | Join Server

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Give Weapon Addon [1.07v]
« Reply #40 on: March 25, 2015, 10:53:51 AM »
I feel it would be easier to read the wep name rather than the script name (wtester would be an example), so that would help. Now I'm assuming this would be for a dropdown menu correct? So you'd be converting the script name, and making it gui friendly with a wep name. Right?

I don't have this addon added, but I plan on installing it tonight.

Indeed.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8083
  • Karma: 389
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Give Weapon Addon [1.07v]
« Reply #41 on: March 25, 2015, 03:05:31 PM »
Majority of people using tools like this would have no idea what a scripted name of a tool/weapon is, especially when a swep dev got creative with a short name or something.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Give Weapon Addon [1.07v]
« Reply #42 on: March 27, 2015, 01:11:32 AM »
Majority of people using tools like this would have no idea what a scripted name of a tool/weapon is, especially when a swep dev got creative with a short name or something.

Well now I remembered why I didn't do it the way I'm, and was speaking about, because it's not possible in ulx at this time.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline DarKevin

  • Newbie
  • *
  • Posts: 23
  • Karma: 1
  • sup
Re: Give Weapon Addon [1.07v]
« Reply #43 on: March 29, 2015, 05:43:24 PM »
Majority of people using tools like this would have no idea what a scripted name of a tool/weapon is, especially when a swep dev got creative with a short name or something.
To get the weapon/swep name you can just open the spawn menu, and right click the weapon icon.
Click "copy to clipboard", then you can paste the swep name in console, etc.
Also works with props (models), entities and NPCs (I think).

You're welcome ;l

PS: Bite That Apple, could you make it possible to give a weapon to multiple people (currently you can only give a weapon to 1 specific player or to everyone with * (?)) and multiple weapons to 1 player? OR even multiple weapons to multiple players xD
Just a suggestion.

Offline ayzen123123

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Give Weapon Addon [1.08v]
« Reply #44 on: November 06, 2016, 01:15:22 PM »
thx give weapon it is good commande