Author Topic: ULX Give - Give weapons to players.  (Read 64742 times)

0 Members and 1 Guest are viewing this topic.

Offline vader0146

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 9
ULX Give - Give weapons to players.
« 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.
« Last Edit: December 02, 2009, 03:11:54 PM by vader0146 »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7987
  • Karma: 374
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Give - Give weapons to players.
« Reply #1 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.
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6205
  • Karma: 394
  • Project Lead
Re: ULX Give - Give weapons to players.
« Reply #2 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.
Experiencing God's grace one day at a time.

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline [NNJG]Ben

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: ULX Give - Give weapons to players.
« Reply #4 on: January 30, 2010, 07:26:07 PM »
how do I make it recognize CSS weapons?

Offline vader0146

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 9
Re: ULX Give - Give weapons to players.
« Reply #5 on: January 30, 2010, 08:04:12 PM »
how do I make it recognize CSS weapons?

it does.

Offline wishbone

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: ULX Give - Give weapons to players.
« Reply #6 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

Offline phoenixf129

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: ULX Give - Give weapons to players.
« Reply #7 on: March 28, 2010, 01:10:09 PM »
sorry to say but this doesnt work iwht the svn anymore :(

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7987
  • Karma: 374
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Give - Give weapons to players.
« Reply #8 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.
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Offline vader0146

  • Jr. Member
  • **
  • Posts: 63
  • Karma: 9
Re: ULX Give - Give weapons to players.
« Reply #9 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

Offline phoenixf129

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: ULX Give - Give weapons to players.
« Reply #10 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

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7987
  • Karma: 374
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Give - Give weapons to players.
« Reply #11 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.
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Offline phoenixf129

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: ULX Give - Give weapons to players.
« Reply #12 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
« Last Edit: April 04, 2010, 05:02:36 AM by phoenixf129 »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7987
  • Karma: 374
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Give - Give weapons to players.
« Reply #13 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.
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Offline phoenixf129

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: ULX Give - Give weapons to players.
« Reply #14 on: April 05, 2010, 08:47:42 AM »
Well i can be stupid sometimes!

That fixed it for me, thanks JamminR!