Possible to have a gun for certain steamid's? DR

I’m wondering if it’s even possible if so how to make a weapon spawn for someone’s specific SteamID on the game mode Deathrun.


-- Run serverside
hook.Add( "PlayerSpawn", "IDWep", function( ply )
   if ( ply:SteamID() = "STEAM_0:0:0" ) then
      ply:Give( "weapon_example" )
   end
end

Added it to autorun and it doesn’t seem to do anything? Should I do like ply:strip or something?

Read the comment at the top of the code; it shouldn’t be in autorun.

I added it to the autorun/server/ still nothing, If that is still the wrong place, I apologize for my lack of intelligence.

You’re missing a “)” after the last end, if OP checked console he would see that there would be an error.

It did not show up, I don’t know why. But after adding that I now get…



[ERROR] lua/autorun/deguns.lua:3: ')' expected near '='
  1. unknown - lua/autorun/deguns.lua:0



Replace “=” with “==”.

I then tried this but it would not work either:


-- Run serverside
hook.Add( "PlayerSpawn", "IDWep", function( ply )
   if ply:IsUserGroup("superadmin") then
      ply:Give( "weapon_hpmstick" )
   end 
end )

[editline]28th June 2014[/editline]

Thanks inter, That fixed all the errors inter but still nothing is spawned…

The ) didn’t copy on my phone; the == is just a mistake; sorry.

I don’t believe IsUserGroup works very often, for ULX at least, which is what I suspect you use.
Try replacing “ply:IsUserGroup( “superadmin” )” with ply:GetNWString( “usergroup” ) == “superadmin”

Just use IsSuperAdmin(). Also, make sure weapon_hpmstick is a valid weapon class.