Ulysses

Ulysses Stuff => Releases => Ulysses Release Archives => Topic started by: vader0146 on December 02, 2009, 04:49:20 AM

Title: ULX Give - Give weapons to players.
Post by: vader0146 on December 02, 2009, 04:49:20 AM
ULX Give by Seth (me!)

Usage:
!give <player> <weapon>
or "ulx give <player> <weapon>"

The script checks to see if the server has the weapon installed.  :)
It gives the weapon specified to the player.

It's in addon format so drop into addons.
This is for ULX v3.40.

I have also attached a version for ULX SVN.
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on December 02, 2009, 04:10:07 PM
Great. Having a release for both svn and non svn versions is a nice touch.
One suggestion if you don't have it planned already... have the <weapon> part of an autocomplete list?
Don't know Gmod's weapon table name off the top of my head, but I'd bet there's a table of them somewhere.
Title: Re: ULX Give - Give weapons to players.
Post by: Megiddo on December 02, 2009, 06:09:29 PM
Great. Having a release for both svn and non svn versions is a nice touch.
One suggestion if you don't have it planned already... have the <weapon> part of an autocomplete list?
Don't know Gmod's weapon table name off the top of my head, but I'd bet there's a table of them somewhere.


I imagine you can get the weapon list programmatically, to boot.
Title: Re: ULX Give - Give weapons to players.
Post by: jay209015 on December 02, 2009, 08:50:34 PM
http://wiki.garrysmod.com/?title=Weapons.GetList
Title: Re: ULX Give - Give weapons to players.
Post by: [NNJG]Ben on January 30, 2010, 07:26:07 PM
how do I make it recognize CSS weapons?
Title: Re: ULX Give - Give weapons to players.
Post by: vader0146 on January 30, 2010, 08:04:12 PM
how do I make it recognize CSS weapons?

it does.
Title: Re: ULX Give - Give weapons to players.
Post by: wishbone on March 14, 2010, 10:09:37 AM
Have to say nice job now i can give my friends weapons when sbox_weapons is 0
Title: Re: ULX Give - Give weapons to players.
Post by: phoenixf129 on March 28, 2010, 01:10:09 PM
sorry to say but this doesnt work iwht the svn anymore :(
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on March 28, 2010, 03:26:59 PM
Are you using the one meant for SVN? There are two versions to download.
Also, not sure how vader feels, but Team Ulysses strongly dislike people who say "it doesn't work", yet give no error messages.
Gmod Lua and ULX both are known quite well for giving verbose error messages.
You should see one on server OR client when 1) the command is run or 2) the server starts up during the ULX loading modules section.
Title: Re: ULX Give - Give weapons to players.
Post by: vader0146 on March 28, 2010, 06:38:59 PM
Are you using the one meant for SVN? There are two versions to download.
Also, not sure how vader feels, but Team Ulysses strongly dislike people who say "it doesn't work", yet give no error messages.
Gmod Lua and ULX both are known quite well for giving verbose error messages.
You should see one on server OR client when 1) the command is run or 2) the server starts up during the ULX loading modules section.

Exactly.

"omg it haz eror!!"=  >:(

"<eof> expected near end" =  ;D
Title: Re: ULX Give - Give weapons to players.
Post by: phoenixf129 on April 03, 2010, 10:47:02 AM
ok heres your error:

Taken straight from my console.log

//  MODULE: givesvn.lua      //
ulx\sh_base.lua:182: table index is nil
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on April 03, 2010, 05:34:28 PM
Much more helpful.

Vader, line 32 of givesvn.lua ... category_name ... you need to set it.
May need to in non-svn too (I didn't look)
You probably already know, but just in case not, that sets what 'section' of the "ulx help" list it goes under, User Management, Utility, etc.
Title: Re: ULX Give - Give weapons to players.
Post by: phoenixf129 on April 04, 2010, 04:49:59 AM
i would say Utility fits this best, and i can attach the version ive got, where ive edited, if vader doesnt mind...
EDIT://

still doesnt work, even though ive gone and put the Utility where CATEGORY_NAME was...

Looking for the error msg:
same as before

ulx\sh_base.lua:182: table index is nil
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on April 04, 2010, 10:08:55 AM
Did you put it in quotes? It's a string.
If so, give vader a chance to look at the code.
Title: Re: ULX Give - Give weapons to players.
Post by: phoenixf129 on April 05, 2010, 08:47:42 AM
Well i can be stupid sometimes!

That fixed it for me, thanks JamminR!
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on April 05, 2010, 10:50:55 AM
Welcome.
Syntax - a coder's worst nightmare
Title: Re: ULX Give - Give weapons to players.
Post by: Goldsun1715 on May 02, 2010, 06:51:56 PM
Uh... so I've got the string right here:

local give = ulx.command( CATEGORY_NAME, "ulx give", ulx.give, "!give" )

What exactly am I supposed to set CATEGORY_NAME to?
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on May 02, 2010, 08:42:49 PM
Look at "ulx help" from console...it's categorized, I forget them off the top of my head, but it's like "Utility", "Player management", "punishment"... some like that.
Change CATEGORY_NAME to the "<category>" you want from the help menu. Enclose the name in quotes.
Title: Re: ULX Give - Give weapons to players.
Post by: Goldsun1715 on May 03, 2010, 02:09:11 PM
Look at "ulx help" from console...it's categorized, I forget them off the top of my head, but it's like "Utility", "Player management", "punishment"... some like that.
Change CATEGORY_NAME to the "<category>" you want from the help menu. Enclose the name in quotes.

Oh thank you very much. :)
Title: Re: ULX Give - Give weapons to players.
Post by: xynetor on May 17, 2010, 05:04:49 AM
I don't know anything about LUA coding but this is the error I get.

Code: [Select]
ulx\modules/givesvn.lua:23: bad argument #1 to 'ipairs' (table expected, got nil)
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on May 17, 2010, 04:21:26 PM
Are you also getting the following error during server startup xynetor?
//  MODULE: givesvn.lua      //
ulx\sh_base.lua:182: table index is nil
If so, follow the instructions from the past few posts for editing CATEGORY_NAME
If not, when does that error occur?
Title: Re: ULX Give - Give weapons to players.
Post by: lavacano201014 on May 29, 2010, 03:09:12 PM
Look at "ulx help" from console...it's categorized, I forget them off the top of my head, but it's like "Utility", "Player management", "punishment"... some like that.
Change CATEGORY_NAME to the "<category>" you want from the help menu. Enclose the name in quotes.

You can also set whatever category you want in there - ULX seems to automatically adjust to it.

I have a "Madhouse" category for my server, and it works fine there.
Title: Re: ULX Give - Give weapons to players.
Post by: specter on August 11, 2010, 11:21:09 AM
I am sorry but how can I make this script available to give a weapon to everyone on the serveR?
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on August 11, 2010, 05:29:50 PM
Pheonix, Seth wrote this to allow ULX multiple player targeting.
Easiest way is to use * in svn, <all> in non-svn
Title: Re: ULX Give - Give weapons to players.
Post by: Blah on March 21, 2012, 01:17:43 PM
Code: [Select]
You do not have access to this command, Blah.
Does not seem to work anymore, I could use this :/
Title: Re: ULX Give - Give weapons to players.
Post by: skydive on March 21, 2012, 01:22:05 PM
Nice  8)
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on March 21, 2012, 02:20:04 PM
Code: [Select]
You do not have access to this command, Blah.
Does not seem to work anymore, I could use this :/
Hey Blah, Technically, it didn't work from first release, but the posts afterward explain how to fix it.
What access are  you on your server, and does it inherit admin?
Title: Re: ULX Give - Give weapons to players.
Post by: smithy285 on December 15, 2012, 03:24:05 AM
Hey Blah, Technically, it didn't work from first release, but the posts afterward explain how to fix it.
What access are  you on your server, and does it inherit admin?
I am having the same problem to.
I am ULX admin and I have made myself admin in the server files as well (e.g userconfig and users.txt) and yet I still get the message that I don't have permission to access it. I am no good at coding and I don't know how to fix it. Any help would be appreciated.
Title: Re: ULX Give - Give weapons to players.
Post by: JamminR on December 15, 2012, 05:01:37 PM
Make sure you're trying the svn zip file.

You don't have to know how to code.
Open the only .lua file in a text editor.
Find where it says CATEGORY_NAME and change it to anything you want in quotes.
I recommend "Utility"

After doing that, if it doesn't work, then it's due to the fact this was released in December 2009.
There have been (virtually) countless number of updates to Gmod, ULX, and ULib since then.
Try PMing the original author, cause he's not been here since 2011, and would most likely not see any errors you post.
Title: Re: ULX Give - Give weapons to players.
Post by: Mesmaroth on February 06, 2013, 10:01:36 PM
Sorry for the bumb. But can someone try updating this? Don't want to use Fadmin for the weapons.