dlist = { "crane_frame.mdl", "models/props_phx/ball.mdl", "models/props_phx/oildrum001_explosive.mdl", "models/props_phx/mk-82.mdl", "models/props_phx/torpedo.mdl", "models/props_phx/ww2bomb.mdl", "models/props_phx/misc/flakshell_big.mdl", "models/props_junk/gascan001a.mdl", "models/props_junk/propane_tank001a.mdl", "models/props_c17/oildrum001_explosive.mdl", "models/props_phx/huge/tower.mdl", "models/props_phx/huge/evildisc_corp.mdl", "models/props_phx/playfield.mdl", "models/props_c17/utilitypole01d.mdl", "models/props_buildings/building_002a.mdl", "models/props_buildings/collapsedbuilding02b.mdl", "models/props_buildings/collapsedbuilding02c.mdl", "models/props_buildings/project_building01.mdl", "models/props_buildings/project_building02.mdl", "models/props_buildings/project_building03.mdl", "models/props_buildings/project_destroyedbuildings01.mdl", "models/props_buildings/row_church_fullscale.mdl", "models/props_buildings/row_corner_1_fullscale.mdl", "models/props_buildings/row_res_1_fullscale.mdl", "models/props_buildings/row_res_2_ascend_fullscale.mdl", "models/props_canal/canal_bridge01.mdl", "models/props_canal/canal_bridge02.mdl", "models/props_canal/canal_bridge03a.mdl", "models/props_canal/canal_bridge03b.mdl" }
Delay = 0.3
XDelay = 1
function setup_propspawn(ply)
ply.denied = false
ply.d_time = 0
ply.t_time = 0
Msg(ply.d_time.. " \n")
end
hook.Add( "PlayerInitialSpawn", "Setup_PropSpawn", setup_propspawn );
function propspawn(ply, mdl)
if CurTime() < ply.d_time then
wait_time = ply.d_time - math.Round(CurTime(),2)
ply:PrintMessage(HUD_PRINTTALK, "You must wait " ..wait_time.. " second(s) before spawning another prop")
return false
end
for k, v in pairs( dlist ) do
if string.find( mdl, v, 1, true ) then
ply.d_time = math.Round(CurTime()) + XDelay
return
else
ply.d_time = math.Round(CurTime()) + Delay
end
end
end
hook.Add( "PlayerSpawnProp", "PropSpawn", propspawn )
function gettool(ply, tr, toolmode)
if CurTime() > ply.t_time then
if toolmode == "adv_duplicator" or toolmode == "duplicator" then
ply.whitelist = true
ply.t_time = math.Round(CurTime(),1) + Delay
ply.d_time = 0
timer.Create( ply:Nick().. "whitelist", 10, 0, timerreset, ply)
else
if toolmode == "ol_stacker" or toolmode == "dynamite" then
ply.t_time = math.Round(CurTime(), 2) + XDelay
else
ply.t_time = 0
end
end
else
t_wait_time = ply.t_time - math.Round(CurTime(), 2)
ply:PrintMessage(HUD_PRINTTALK, "You must wait " ..t_wait_time.. " second(s) before using another tool")
ply.whitelist = false
return false
end
end
hook.Add( "CanTool", "GetTool", gettool)
function timereset( ply )
ply.d_time = CurTime() + Delay
ply.t_time = 0
timer.Destroy( ply:Nick().. "whitelist" )
end