View Single Post
Old 08-24-2012, 08:55 AM   #1
[TALOS]Smoke
 
Join Date: Jul 2012
Location: Killeen, Tx, USA
Class/Position: Demo Defense
Gametype: Capture the Flag
Affiliations: [TALOS]
Posts Rated Helpful 3 Times
need to remove grenades on spawn

I want to remove the grenades from a sniper when they spawn (for a sniper map) I have everything else set up and is working great except for the player spawning with 2 nades. Help please here's the lua:

IncludeScript("base_location");
IncludeScript("base_teamplay");

function startup()

SetPlayerLimit( Team.kBlue, 0 )
SetPlayerLimit( Team.kRed, 0 )
SetPlayerLimit( Team.kYellow, -1 )
SetPlayerLimit( Team.kGreen, -1 )

local team = GetTeam( Team.kRed )
team:SetClassLimit( Player.kScout, -1 )
team:SetClassLimit( Player.kSniper, 0 )
team:SetClassLimit( Player.kSoldier, -1 )
team:SetClassLimit( Player.kDemoman, -1 )
team:SetClassLimit( Player.kMedic, -1 )
team:SetClassLimit( Player.kHwguy, -1 )
team:SetClassLimit( Player.kPyro, -1 )
team:SetClassLimit( Player.kSpy, -1 )
team:SetClassLimit( Player.kEngineer, -1 )
team:SetClassLimit( Player.kCivilian, -1 )

local team = GetTeam( Team.kBlue )
team:SetClassLimit( Player.kScout, -1 )
team:SetClassLimit( Player.kSniper, 0 )
team:SetClassLimit( Player.kSoldier, -1 )
team:SetClassLimit( Player.kDemoman, -1 )
team:SetClassLimit( Player.kMedic, -1 )
team:SetClassLimit( Player.kHwguy, -1 )
team:SetClassLimit( Player.kPyro, -1 )
team:SetClassLimit( Player.kSpy, -1 )
team:SetClassLimit( Player.kEngineer, -1 )
team:SetClassLimit( Player.kCivilian, -1 )
end

-- Get team points for killing a player
function player_killed( player_entity, damageinfo )
local killer = GetAttacker.GetAttacker()

local player = CastToPlayer( player_entity )
if IsPlayer(killer) then
killer = CastToPlayer(killer)
--local victim = GetPlayer(player_id)

if not (player:GetTeamId() == killer:GetTeamId()) then
local killersTeam = killer:GetTeam()
killersTeam:AddScore(1)
end
end
end
sniperpack = genericbackpack:new({
health = 100,
armor = 50,
grenades = 0,
bullets = 0,
nails = 0,
shells = 75,
rockets = 0,
cells = 0,
gren1 = 0,
gren2 = 0,
respawntime = 1,
model = "models/items/backpack/backpack.mdl",
materializesound = "Item.Materialize",
touchsound = "Backpack.Touch",
botgoaltype = Bot.kBackPack_Ammo
})
function grenadebackpack:dropatspawn() return false
end
[TALOS]Smoke is offline   Reply With Quote