• Weapon For Specific Player
    8 replies, posted
How could I make it so only one specific player with a specified SteamID could spawn with a weapon. In this case, the weapon is "admin_stick".
SWEP.AdminOnly = true
[QUOTE=Robotboy655;44095044]SWEP.AdminOnly = true[/QUOTE] I don't want admins spawning it. Just me.
Put this: [code]if self.Owner:SteamID() != "urstemid" then self:Remove() end[/code] into your SWEP:Deploy or SWEP:Think
Would it be possible to automatically make me spawn with it every time? If not, I'll just use that and spawn it manually, I guess.
[code]hook.Add("PlayerSpawn","why",function( p ) if ( p:SteamID() == "ursteemId" ) then p:Give("wepon-clas") end end)[/code]
[QUOTE=Robotboy655;44095264][code]hook.Add("PlayerSpawn","why",function( p ) if ( p:SteamID() == "ursteemId" ) then p:Give("wepon-clas") end end)[/code][/QUOTE] Sorry, but where would I add this?
Anywhere when it gets called by server. In your SWEP, outside of any functions, in a "if SERVER then /*code*/ end" will do.
Thanks! It worked.
Sorry, you need to Log In to post a reply to this thread.