• Prop Banner
    2 replies, posted
Like the title says, I need a lua script that bans props listed inside it, and when you type a certain command in console (as admin of course) like Banprop (XXX_XXX.mdl) it bans the prop from being spawned. Also i need a command that toggles the banned prop list. By prop banning i mean prevent it from being spawned :P
[lua]local BANNEDPROPS = {} function BanProp( model ) table.insert( BANNEDPROPS , model ) end BanProp( "models/props_c17/oildrum001_explosive.mdl" ) BanProp( "models/props/de_inferno/bell_small.mdl" ) BanProp( "bell_small" ) BanProp( "models/props/de_inferno/bell_large.mdl" ) BanProp( "bell_large" ) BanProp( "models/props/de_inferno/bell_largeb.mdl" ) BanProp( "models/props_combine/prison01.mdl" ) BanProp( "models/props_combine/prison01c.mdl" ) BanProp( "models/props_combine/prison01b.mdl" ) BanProp( "models/props_phx/amraam.mdl" ) BanProp( "models/props_phx/oildrum001_explosive.mdl" ) BanProp( "models/props_phx/torpedo.mdl" ) BanProp( "models/props_phx/ww2bomb.mdl" ) BanProp( "models/props_phx/misc/flakshell_big.mdl" ) BanProp( "models/props_phx/mk-82.mdl" ) BanProp( "amraam" ) BanProp( "oildrum001_explosive" ) BanProp( "torpedo" ) BanProp( "ww2bomb" ) BanProp( "flakshell_big" ) BanProp( "mk-82" ) BanProp( "props_phx/ball") BanProp( "props_phx/huge/") BanProp( "models/props_explosive/explosive_butane_can.mdl") BanProp( "models/props_explosive/explosive_butane_can02.mdl") hook.Add( "PlayerSpawnProp" , "CheckProp" , function( pl, model) model = string.lower( model ) local found = false for k,v in ipairs( BANNEDPROPS ) do if string.find( model, v ) then found = true end end if table.HasValue( BANNEDPROPS, model ) or found then pl:ChatPrint( model .. " is Banned!" ) return false end end )[/lua]
[QUOTE=blackops7799;19948041][lua]local BANNEDPROPS = {} function BanProp( model ) table.insert( BANNEDPROPS , model ) end BanProp( "models/props_c17/oildrum001_explosive.mdl" ) BanProp( "models/props/de_inferno/bell_small.mdl" ) BanProp( "bell_small" ) BanProp( "models/props/de_inferno/bell_large.mdl" ) BanProp( "bell_large" ) BanProp( "models/props/de_inferno/bell_largeb.mdl" ) BanProp( "models/props_combine/prison01.mdl" ) BanProp( "models/props_combine/prison01c.mdl" ) BanProp( "models/props_combine/prison01b.mdl" ) BanProp( "models/props_phx/amraam.mdl" ) BanProp( "models/props_phx/oildrum001_explosive.mdl" ) BanProp( "models/props_phx/torpedo.mdl" ) BanProp( "models/props_phx/ww2bomb.mdl" ) BanProp( "models/props_phx/misc/flakshell_big.mdl" ) BanProp( "models/props_phx/mk-82.mdl" ) BanProp( "amraam" ) BanProp( "oildrum001_explosive" ) BanProp( "torpedo" ) BanProp( "ww2bomb" ) BanProp( "flakshell_big" ) BanProp( "mk-82" ) BanProp( "props_phx/ball") BanProp( "props_phx/huge/") BanProp( "models/props_explosive/explosive_butane_can.mdl") BanProp( "models/props_explosive/explosive_butane_can02.mdl") hook.Add( "PlayerSpawnProp" , "CheckProp" , function( pl, model) model = string.lower( model ) local found = false for k,v in ipairs( BANNEDPROPS ) do if string.find( model, v ) then found = true end end if table.HasValue( BANNEDPROPS, model ) or found then pl:ChatPrint( model .. " is Banned!" ) return false end end )[/lua][/QUOTE] Thanks bro! :D
Sorry, you need to Log In to post a reply to this thread.