Ulysses
Ulysses Stuff => Ulysses Release Archives => Releases => Releases for ULX v1.* => Topic started by: Golden-Death on December 17, 2005, 02:49:29 PM
-
This script will check to see if your an admin on a certain list and kill you if you are not supposed to have the gun.
Installation:
Find the script of the gun you want to use. (ex: gmod9/lua/weapons/bangun/bangun.lua)
Find the part that says (or something similar)
-- Called when player picks up weapon
function onPickup( userid )
end
Copy everything from 'function' to 'end' and delete it, so you should be deleting this:
function onPickup( userid )
end
Now where that originally was, paste this:
function onPickup( pickerup )
_OpenScript( "wepadminlist.lua" );
if (_PlayerInfo( pickerup, "networkid" ) == AUTHID1) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID2) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID3) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID4) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID5) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID6) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID7) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID8) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID9) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID10) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID11) then
_Msg( "Authorized." )
else
_Msg( "No acess!" )
_ScreenText( pickerup, "You do not have permission to use this weapon",0, 0, 255,0,0,255,1,1,2,1,0)
_PlayerSilentKill( pickerup, 1, true )
end
end
Now, create a new lua file called 'wepadminlist' (It must be called this and must be in the same folder as the weapons it is used in).
Inside, paste this:
AUTHID1 = "Steam ID Here";
AUTHID2 = "Steam ID Here";
AUTHID3 = "Steam ID Here";
AUTHID4 = "Steam ID Here";
AUTHID5 = "Steam ID Here";
AUTHID6 = "Steam ID Here";
AUTHID7 = "Steam ID Here";
AUTHID8 = "Steam ID Here";
AUTHID9 = "Steam ID Here";
AUTHID10 = "Steam ID Here";
AUTHID11 = "Steam ID Here";
For every admin, replace the part inside the quotes that says Steam ID Here, and replace it with the admin's steamid.
and your done.
-
Oh, nice work, maybe Meggeh could help you use the ULX admin list.
-
Use _PlayerSilentKill instead. It kills em even when they have buddha.
-
Uh... please use ULX for that user list... that's terrible. Read the docs at http://wiki.ulyssesmod.net/
-
redid it
-
Nice one.
-
Please update this plugin to use ULX v1.1's new module system
-
I put it at the top of all my admin only guns, and anyone can still pick them up, and in the master console it just says.
[LUA] Error calling 'onPickup' : 'Line 3: attempt to call global 'hasAccess' <anil value>'
can someone tell me what I'm doing wrong?
Thank youuuu
-Atomix
-
Its probobly because meg has changed the code for the new version. Ill see what I can do to update it.
-
Nope, hasAccess still exists, if it says it's nil he's probably not using ULX.
-
Ah, yes you need ULX to use this.
-
Thanks SOOOO Much!.
Very Very Very usuful for construct servers.
-
Could you please explain a bit more.
I have downloaded ULX 1.1 and set up correctly because im admin.
I have putten the script above the .lua from the weapon and i get the same error as Atomix.
Please explain a bit better what I'm doing wrong.
-
Do you have ULX installed and working correctly?
-
Well i think so I am admin and all commands are working so i think it's installed correctly.
-
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)
] 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!
-
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:
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:
_ServerCommand("gd_test\n")
Now load the game and type
lua_openscript access.lua
then load your weapon. If you can use it, the console should say authorized, if not, it should say No Access. Please confirm.
-
Well it says authorized when i spawn it and pick it up. BUT Normal players can still pick it up.
-
Yeah I've noticed that too, I have no idea why. Is hasAccess broken?
-
Ok thanks for helping. When you have a fix please post it. ;D
-
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.
-
Any fixes yet?
-
No, sorry, been too busy. I get home at 7:30 every day this week and next. orchestra
-
Ok no problem. I can wait.
-
As soon as I find the code that converts playerid to steamid, this will be fixed.
-
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.
-
I wish I had a dime for every time someone blamed their problems on me... I'd be a rich man... very rich.
-
Does this have to be in the weapon script or can i just paste the new code at the top of the script?
function onPickup( userid )
end
-
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
-
Oh ok tnx for the helping going to test it.
-
Can i put all the weapons in like one folder called Admin SWEPS and then put the steamid's in there too would that work?
-
It's not really working for me. It sees the wepadminlist as a SWEP weapon and when i add my steamid in the list im still not authorized to use the gun.
-
Just to make sure its proper, could you post the SWEP and the admin list for me?
-
Adminlist:
AUTHID1 = "STEAM_0:0:187892";
AUTHID2 = "Steam ID Here";
AUTHID3 = "Steam ID Here";
AUTHID4 = "Steam ID Here";
AUTHID5 = "Steam ID Here";
AUTHID6 = "Steam ID Here";
AUTHID7 = "Steam ID Here";
AUTHID8 = "Steam ID Here";
AUTHID9 = "Steam ID Here";
AUTHID10 = "Steam ID Here";
AUTHID11 = "Steam ID Here";
SWEP(Blackholegun):
function onPickup( pickerup )
_OpenScript( "wepadminlist.lua" );
if (_PlayerInfo( pickerup, "networkid" ) == AUTHID1) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID2) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID3) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID4) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID5) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID6) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID7) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID8) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID9) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID10) or
(_PlayerInfo( pickerup, "networkid" ) == AUTHID11) then
_Msg( "Authorized." )
else
_Msg( "No acess!" )
_ScreenText( pickerup, "You do not have permission to use this weapon",0, 0, 255,0,0,255,1,1,2,1,0)
_PlayerSilentKill( pickerup, 1, true )
end
end
--[[ ______________________________________________
|¡!¡!¡!¡!¡!¡ Black Hole Gun !¡!¡!¡!¡!¡!¡|
|!¤¡!¡!¡!¤¡! v. 1.8 ¡!¤¡!¡!¡!¡¤!|
|¡!¡!¡!¡!¡!¡!¡!¡ By !¡!¡!¡!¡!¡!¡!¡!¡!¡|
|!¡!¡!¤¡!¡!¡ TrinitronX (enTity) !¡!¡!¡¤!¡!¡!|
|¡!¡!¡!¡!¡!¡ ROBO DONUT !¡!¡!¡!¡!¡!¡|
|!¤¡!¡!¡!¤¡¡ and ¡!¤¡!¡!¡!¡¤!|
|¡!¡!¡!¡!¡!¡ dssalmon !¡!¡!¡!¡!¡!¡|
|¡¤¡!¡!¡¤¡ vector/angle functions by ¡¤¡!¡!¡¤¡|
|¡!¡!¤!¡!¡ GeoGriff ¡!¡!¤!¡!¡|
|¡¤¡!¡!¡¤¡ gun inspired by NeoSeeker ¡¤¡!¡!¡¤¡|
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Feel free to use this, or modify it.. as long as you give the authors credit. Thanks!
]]
-- global variables that can tweak the effects of the black hole (feel free to change them if wanted)
affectplayers = true; -- whether or not the black hole will suck players in (default true). Set to false to not pull in players.
affectnpcs = true; -- whether or not the black hole will suck in npcs (default true)
-- Shot related settings
local fieldtime = 10; --default is 7 (the amount of time the black hole is in effect for.. note that changing this may offset the black hole's sound effects)
local shotmovetime = 3; --default is 3 (the amount of time the black hole ball can move around)
-- Black hole related settings
blackholeforce = 90000000; --90000000 is default for the black hole's force. Use less to give it less pull
blackholeouterradius = 300000; --default is 300000 (effects the outer/pulling radius of the black hole)
blackholeinnerradius = 70; --default is 70 (effects the inner deletion/kill radius of the black hole)
Code for the SWEP is to long so i only posted the begin.
-
Works for me. Try making sure your Steamid is what it is when your ingame. WHen your on singleplayer, it may be UNKNOWN so thats what youd have to put in there.
-
Ok ill try. When not working i'll post again. :P
-
Ok i found out that i missed one number in my STEAMID. I put that number in and it still says No access and i get slayed.
-
And your steamid that you entered is the exact one that comes up when you type status?
-
Yes i copied it.
-
Huh... I don't really know. However, when I was testing it, I never had a problem with it not giving access... when it was broken, it always gave access, not vice versa, so there must be something wrong with the steam id list or something
-
Can be, because i have another admin only SWEP script and when i add my id there it doesn't give me access. So I'll try it with my friend his id and see if he get's access.
-
I found out the problem with the script.
Well, move your wepadminlist.lua to the GMod9/lua folder, but leave everything else the same. It worked perfectly.
I'm currently using ULX v1.13 if that has anything to do with it. I'm just now starting to teach myself LUA so I don't know much.