Ulysses

Ulysses Stuff => Releases => Topic started by: Bite That Apple on April 08, 2013, 04:45:06 PM

Title: Give Weapon Addon [1.08v]
Post by: Bite That Apple on April 08, 2013, 04:45:06 PM
Give Weapon Addon

This plugin is basic, all you do is type !giveweapon PLAYERNAME WEAPONNAME and it gives it to you, you need to know the name of the weapon though (and it's not the name with spaces in it, it's the name of the weapon that has underscores, and most likely pops up in console.) I made this plugin only because CSS Realistic Weapons are bugged, and it didn't show the admin weapon (unless you searched it, which is not really fun :() so I ended up making a plugin just so I could spawn the admin weapon on my server

Please Keep Note:
If you like this addon, I would really appreciate a "Compliment" Karma which is located next to my name. That's how I know you care :)
You must be registered and logged in the ulx forum to see the download link which is found under the preview image


HOW TO USE:
You can type !giveweapon PLAYERNAME WEAPONNAME or do !menu and go to "Apple's Creations" and find "Give Weapon". It's somewhat simple to use


FEATURES:


KNOWN BUGS:
Nothing that I see


Preview:
(http://i1044.photobucket.com/albums/b449/chaos13125/Untitled-11_zps75b3f33f.png) (http://s1044.photobucket.com/user/chaos13125/media/Untitled-11_zps75b3f33f.png.html)


DOWNLOAD LINK BELOW
You must be registered and logged in the ulx forum to see the download link which is found under the preview image
Title: Re: Give Weapon Addon
Post by: Bite That Apple on June 13, 2013, 03:28:25 PM
Updated.
Title: Re: Give Weapon Addon
Post by: Megiddo on June 13, 2013, 05:31:21 PM
Missed this plugin the first time around (April was a bad month), good work chaos!
Title: Re: Give Weapon Addon
Post by: Bite That Apple on June 13, 2013, 05:33:47 PM
Missed this plugin the first time around (April was a bad month), good work chaos!

Thanks, I'm trying my best to get some better addons out this summer.
Title: Re: Give Weapon Addon
Post by: itsCrafted on July 19, 2013, 10:20:13 AM
Sorry to bump, but, could you update, please?
Title: Re: Give Weapon Addon
Post by: Bite That Apple on July 19, 2013, 10:22:31 AM
Sorry to bump, but, could you update, please?

Could you please give a description on what needs to be updated on this? (i.e. is it not working? something else?)
Title: Re: Give Weapon Addon
Post by: itsCrafted on July 19, 2013, 10:31:14 AM
Could you please give a description on what needs to be updated on this? (i.e. is it not working? something else?)

Sorry - for a minute I thought it was broken. While you're here, though, do you think you could add a 'silent' option?

EDIT: I meant to ask for an update on the playurl thread.
Title: Re: Give Weapon Addon
Post by: Bite That Apple on July 19, 2013, 10:35:21 AM
Sorry - for a minute I thought it was broken. While you're here, though, do you think you could add a 'silent' option?

Umm, yeah it would be easy. Let me look into it right now.
Title: Re: Give Weapon Addon
Post by: Bite That Apple on July 19, 2013, 10:59:47 AM
Sorry - for a minute I thought it was broken. While you're here, though, do you think you could add a 'silent' option?

EDIT: I meant to ask for an update on the playurl thread.


There you go.
Title: Re: Give Weapon Addon
Post by: sidashley on August 13, 2013, 08:24:24 AM
Amazing script, thank you so much for sharing!
Title: Re: Give Weapon Addon
Post by: Storm on November 09, 2013, 06:18:43 AM
This doesnt seem to work in TTT.
Title: Re: Give Weapon Addon
Post by: Bite That Apple on November 09, 2013, 01:20:38 PM
This doesnt seem to work in TTT.

What error is coming up, or what weapon name are you using?
Title: Re: Give Weapon Addon
Post by: Storm on November 09, 2013, 01:41:33 PM
I was using the default weapon in the plugin - weapon_357 - and i tried some others like shotgun. The chat printout actually says i gave it to myself but when i scroll through my weapons (and look on the ground) it just isnt there.
Title: Re: Give Weapon Addon
Post by: MrSpencer on November 09, 2013, 09:16:53 PM
TTT Has different weapon codes that override normal weapon names. So shotgun isn't valid
Title: Re: Give Weapon Addon
Post by: hanm13 on December 06, 2013, 04:55:40 PM
THX
Title: Re: Give Weapon Addon
Post by: notownz on October 09, 2014, 04:07:34 AM
This met be a noob question! :) Is there a command to give all player or group the same weapon and ammo, instead of doing it one by one? Also is there an way to add a drop down box with all the weapon list in give weapon?

Thanks
notownz
Title: Re: Give Weapon Addon
Post by: Bite That Apple on October 09, 2014, 07:10:52 PM
This met be a noob question! :) Is there a command to give all player or group the same weapon and ammo, instead of doing it one by one? Also is there an way to add a drop down box with all the weapon list in give weapon?

Thanks
notownz

It's been a long time since I messed with this, so w/e the command is atm, I think it's !givegun or !giveweapon then do !givegun * GUN_NAME or !giveweapon * GUN_NAME. If that doesn't work, you can get back to me. There is a way to do the drop down menu, I just haven't had time to do it yet.
Title: Re: Give Weapon Addon
Post by: notownz on October 09, 2014, 08:40:33 PM
Thanks for the fast reply. I will test it out.

Thank You
Notownz
Title: Re: Give Weapon Addon
Post by: notownz on October 15, 2014, 10:47:43 PM
The command works. Just a heads up for anyone looking for the commands to give weapon to everyone.

Give Command. "(*) represent everyone"
!give * weapon_rpg (you give everyone rpg)
!give notownz weapon_rpg (you give notownz rpg)

Default Weapons Name
weapon_frag, weapon_357, weapon_pistol, weapon_rpg, weapon_smg1, weapon_crowbar, weapon_shotgun, weapon_fists, weapon_crossbow, weapon_ar2.

You can also add other weapon but you need to know the weapon name, you can usually find it in the lua file.

Thanks
notownz
Title: Re: Give Weapon Addon
Post by: Bite That Apple on October 16, 2014, 08:16:02 AM
It's on my todo list, that I change the file and make a dropdown menu.... so yeah.
Title: Re: Give Weapon Addon
Post by: notownz on October 16, 2014, 01:02:11 PM
Thanks a bunch can't wait to test it. Keep up the awesome job you are doing.

Thank You
notownz
Title: Re: Give Weapon Addon
Post by: Bite That Apple on November 12, 2014, 06:50:57 PM
Updated All Plugins:
I updated all files/folder names to lowercase and underscores so that we won't have a problem with linux based server.

Special Thanks to Princess Twilight Sparkle
Title: Re: Give Weapon Addon
Post by: RDGXTECHX on December 01, 2014, 08:01:29 PM
Do you have a way where you could have a "give all weapons" option in the pointshop?

For example, whatever is listed in the weapons section would be included in the list and you can select a player and give every weapon to them if they match a specific group. It would be in the admin section of the pointshop like the give weapon command and would allow the player to have the weapon permanently like the original give weapon command. This would make it easier for admins to give all weapons with one button instead of having to go through each weapon and giving it to the player.

If this is possible, can you have an option to reverse that command and remove all weapons from the player? I made a post like this on facepunch but no one commented on it  :-\
Title: Re: Give Weapon Addon
Post by: Bite That Apple on December 01, 2014, 08:59:25 PM
Do you have a way where you could have a "give all weapons" option in the pointshop?

This addon is not compatible with pointshop as far as I know, unless you downloaded someone elses version of this, or in general downloaded someone else addon. This module is for ulx admin mod, and all it does it gives weapons to specific players where the giving user has permission to do so.

If this is possible, can you have an option to reverse that command and remove all weapons from the player? I made a post like this on facepunch but no one commented on it  :-\

If I remember correctly (and if I don't, chances are someone will correct me), there is a command called, !strip, or in console its called ulx strip, and it removes all weapons from specified players.
Title: Re: Give Weapon Addon
Post by: RDGXTECHX on December 02, 2014, 05:15:24 AM
But do you know of someway to make something similar to work for the pointshop? This is a nice add-on for ulx but I was hoping there might be a pointshop option to give all weapons listed in the weapons section. Yes there is a !strip command but that only strips them of the weapons that they have equipped, not the weapons that they can re-equip in the pointshop.

I would like to have it so if someone wants a permanent weapon, it will let them keep the weapons and all they would have to do is equip them in the pointshop. This addon sounds like it just gives them the weapon temporarily and then the next round it's gone (I'm doing this for a TTT server, should have mentioned earlier ;D)
Title: Re: Give Weapon Addon
Post by: Bite That Apple on December 02, 2014, 03:55:45 PM
But do you know of someway to make something similar to work for the pointshop? This is a nice add-on for ulx but I was hoping there might be a pointshop option to give all weapons listed in the weapons section. Yes there is a !strip command but that only strips them of the weapons that they have equipped, not the weapons that they can re-equip in the pointshop.

I would like to have it so if someone wants a permanent weapon, it will let them keep the weapons and all they would have to do is equip them in the pointshop. This addon sounds like it just gives them the weapon temporarily and then the next round it's gone (I'm doing this for a TTT server, should have mentioned earlier ;D)

Yeah, majority of my addons are for sandbox (not strictly). I'm not really sure how Pointshop works, as it was a failure back in 2009, and completely dumb to be quite honest, but it sounds like it uses a database, it wouldn't be too hard to look at and create it myself for you if you want. Though, you need to tell me now, and I'll see what I can do for you. No guarantees though.
Title: Re: Give Weapon Addon
Post by: RDGXTECHX on December 02, 2014, 06:06:53 PM
I just got the database setup on my server now, and if you want to code it and you can post it for the public or you can test it and send it to me. Either way works, I don't want to give someone I just met access to my server so that's out ;)

You can add me on steam to ask anything http://steamcommunity.com/id/CHIEFDAC (http://steamcommunity.com/id/CHIEFDAC)
Title: Re: Give Weapon Addon
Post by: Bite That Apple on December 02, 2014, 11:09:46 PM
I just got the database setup on my server now, and if you want to code it and you can post it for the public or you can test it and send it to me. Either way works, I don't want to give someone I just met access to my server so that's out ;)

You can add me on steam to ask anything http://steamcommunity.com/id/CHIEFDAC (http://steamcommunity.com/id/CHIEFDAC)

I'm not talking about editing your database at all. What I said was I could make an addon that edits the database for you to remove all weapons from a certain player. Though I'd need your version of pointshop, and you can remove all the "private things", and I'll just look at what I need to look at.
Title: Re: Give Weapon Addon
Post by: RDGXTECHX on December 03, 2014, 02:35:57 PM
That's what I assumed but there might have been that chance where you needed access to server files and other things, but the pointshop I use should be in the attachments. There are items in the specified folders, the weapons are the defaults for Counter Strike Source and one weapon from M9K. There's nothing that would be information for the server either since this isn't the sql add-on to the pointshop so nothing to worry about there.

Any questions or concerns you can post here and I'll comment back. Good luck!
Title: Re: Give Weapon Addon
Post by: Bite That Apple on December 03, 2014, 05:42:41 PM
That's what I assumed but there might have been that chance where you needed access to server files and other things, but the pointshop I use should be in the attachments. There are items in the specified folders, the weapons are the defaults for Counter Strike Source and one weapon from M9K. There's nothing that would be information for the server either since this isn't the sql add-on to the pointshop so nothing to worry about there.

Any questions or concerns you can post here and I'll comment back. Good luck!

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?
Title: Re: Give Weapon Addon
Post by: RDGXTECHX 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 (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.
Title: Re: Give Weapon Addon
Post by: Bite That Apple 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.
Title: Re: Give Weapon Addon
Post by: RDGXTECHX 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).
Title: Re: Give Weapon Addon
Post by: Neku 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 (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
Title: Re: Give Weapon Addon
Post by: Bite That Apple on February 03, 2015, 11:25:27 PM
Updated addon to current system!
Title: TTT weapon code
Post by: Max 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.
Title: Re: Give Weapon Addon [1.07v]
Post by: Decicus 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 (https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_ttt_confgrenade.lua#L8).
Title: Re: Give Weapon Addon [1.07v]
Post by: allofmywutsteam on March 25, 2015, 08:30:20 AM
Pretty sure the discombobulator would be weapon_ttt_confgrenade (https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_ttt_confgrenade.lua#L8).

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 (http://pastebin.com/8Gr2vN3D)
Title: Re: Give Weapon Addon [1.07v]
Post by: Bite That Apple 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?
Title: Re: Give Weapon Addon [1.07v]
Post by: allofmywutsteam 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.
Title: Re: Give Weapon Addon [1.07v]
Post by: Bite That Apple 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.
Title: Re: Give Weapon Addon [1.07v]
Post by: JamminR 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.

Title: Re: Give Weapon Addon [1.07v]
Post by: Bite That Apple 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.
Title: Re: Give Weapon Addon [1.07v]
Post by: DarKevin 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.
Title: Re: Give Weapon Addon [1.08v]
Post by: ayzen123123 on November 06, 2016, 01:15:22 PM
thx give weapon it is good commande
Title: Re: Give Weapon Addon [1.08v]
Post by: Puro on December 22, 2020, 06:16:45 AM
It doesn't work
Title: Re: Give Weapon Addon [1.08v]
Post by: JamminR on December 22, 2020, 02:15:58 PM
How do you know? Prove it. We're not taking your word for it unless you tell us errors you get in console (server and client), and what you've tried to troubleshoot.
"it doesn't work" has never been a good start to explaining an issue. It may work for others, just not you. (and, often in development, that is the case after a release of any code). Sure, this release is 7 years old, but I'm not moving it to archives because there's no good evidence indicating it doesn't