• Headshot Round
    4 replies, posted
I have a headshot custom round on my server, but there is a bug that spectators have deagles during the round, like everyone else, and they can SHOOT everyone. How would I make it so when the deagles are given out it ignores the spectator team? I was thinking if ply:IsSpec() then return end is that incorrect?
[lua]function PlayerCheck( ply ) for k,v in pairs( player.GetAll() ) do if ( v:IsTerror() ) then return end end [/lua] Try that (untested)
Your line should work fine even ply:Alive() could go in there. If you're unsure about something like that, then just test it. Best way to learn.
[code] function EVENT:Begin() if ply:IsSpec() then return end for _,ply in pairs(player.GetAll()) do ply:StripWeapons() local deagle = ply:Give("weapon_zm_revolver") ply:SetAmmo(1000, deagle:GetPrimaryAmmoType()) end end [/code] this does not work, help?
[code] function EVENT:Begin() for _, ply in pairs(player.GetAll()) do if not ply:IsSpec() then ply:StripWeapons() local deagle = ply:Give("weapon_zm_revolver") ply:SetAmmo(1000, deagle:GetPrimaryAmmoType()) end end end [/code]
Sorry, you need to Log In to post a reply to this thread.