ULX

Author Topic: Gun Admin Check  (Read 33258 times)

0 Members and 2 Guests are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #15 on: March 25, 2006, 01:17:47 PM »
Well im stumped. For some reason, no matter what I do, if I run any script that has a ULX specific function, it doesnt work. (IE: hasAccess keeps coming out as a nil value, as well as CONCOMMAND)

Code: [Select]

] lua _PlayerGiveSWEP(1,"jetpack.lua")
Lua Error: Line 8: attempt to call global 'ULX_CONCOMMAND' (a nil value)
LUA: Errors when running script 'access.lua'
] lua_openscript access.lua
] gd_test
No access for you!


Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #16 on: March 25, 2006, 01:35:56 PM »
Bah im beginnign to hate this thing. Please tell me if this works.

Make a lua file called 'access.lua' in the lua folder. Fill it:
Code: [Select]
function cc_gd_test( userid, args, argv, argc )
  if hasAccess( userid, ACCESS_KICK ) == true then
    ulx_console( userid, "Authorized." )
  else
    ulx_console( userid, "No Access." )
  end
end
ULX_CONCOMMAND( "gd_test", cc_gd_test )

Open the weapon script, add to the top:
Code: [Select]
_ServerCommand("gd_test\n")

Now load the game and type
Code: [Select]
lua_openscript access.luathen load your weapon. If you can use it, the console should say authorized, if not, it should say No Access. Please confirm.


Offline Slayer_NL

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Gun Admin Check
« Reply #17 on: March 26, 2006, 04:22:41 AM »
Well it says authorized when i spawn it and pick it up. BUT Normal players can still pick it up.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #18 on: March 26, 2006, 09:43:38 AM »
Yeah I've noticed that too, I have no idea why. Is hasAccess broken?


Offline Slayer_NL

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Gun Admin Check
« Reply #19 on: March 27, 2006, 05:17:49 AM »
Ok thanks for helping. When you have a fix please post it. ;D

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Gun Admin Check
« Reply #20 on: March 27, 2006, 06:47:53 AM »
Yeah I've noticed that too, I have no idea why. Is hasAccess broken?

Don't kid yourself GD. Try putting debug messages in your code to see what's wrong.
Experiencing God's grace one day at a time.

Offline Slayer_NL

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Gun Admin Check
« Reply #21 on: March 28, 2006, 07:11:59 AM »
Any fixes yet?

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #22 on: March 28, 2006, 07:27:09 PM »
No, sorry, been too busy. I get home at 7:30 every day this week and next. orchestra


Offline Slayer_NL

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Gun Admin Check
« Reply #23 on: March 29, 2006, 04:11:40 AM »
Ok no problem. I can wait.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #24 on: March 29, 2006, 10:13:55 PM »
As soon as I find the code that converts playerid to steamid, this will be fixed.


Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #25 on: March 29, 2006, 10:26:03 PM »
Ok I fixed it, see the first post for details.

Edit: Yeah, I used my own custom admin list. I can't be bothered to figure out whats wrong with the ULX admins list with what little time I have.
« Last Edit: March 29, 2006, 10:32:45 PM by Golden-Death »


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Gun Admin Check
« Reply #26 on: March 30, 2006, 08:15:24 AM »
I wish I had a dime for every time someone blamed their problems on me... I'd be a rich man... very rich.
Experiencing God's grace one day at a time.

Offline Slayer_NL

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Gun Admin Check
« Reply #27 on: March 30, 2006, 10:25:56 AM »
Does this have to be in the weapon script or can i just paste the new code at the top of the script?
Code: [Select]
function onPickup( userid )
end

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Gun Admin Check
« Reply #28 on: March 30, 2006, 03:38:52 PM »
Im not blaming you Meg, im simply stating that Ive tried all I can.

You replace that code with the one in the first post


Offline Slayer_NL

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Gun Admin Check
« Reply #29 on: March 31, 2006, 05:22:12 AM »
Oh ok tnx for the helping going to test it.