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.