• Looking for a module that saved all ents/weapons/etc and requesting a weapon script.
    3 replies, posted
Awhile ago I found a module that saved all entities on the server, even after the server crashed. An example for the module was him showing how a money printer saved on the map. I can't seem to find what the module, and have no idea what it was called. If someone can be so kind as to link me to it, that'd be great :buddy: And for the weapon script, can someone make me a script that deletes any weapon_'s that have been on the map sitting there for over 10 minutes (Only weapon ents)? [editline]wasn'tapost[/editline] Any by this I mean don't delete weapons every 10 minutes, I mean start a timer, or something, once a weapon is on the ground, and after 10 minutes of it being dropped it disappears. Once it's picked up, the timer stops and lets it be equipped. Thank you for any help.
[lua]WeaponCleanupTime = 600 -- Seconds function WeaponCleanupTimer() for k, v in pairs( ents.GetAll() ) do if string.find( v:GetClass(), "weapon" ) and not ( string.find( string.lower( tostring( v:GetOwner() ) ), "player" ) ) and not ( string.find( string.lower( tostring( v:GetOwner() ) ), "npc" ) ) then -- If it's a weapon, but not on the player... if not v.WeaponTimer then v.WeaponTimer = CurTime() + WeaponCleanupTime -- Start timer elseif v.WeaponTimer <= CurTime() then v:Remove() -- Remove if timer runs out elseif NoDroppedWeapons then v:Remove() end end end end hook.Add( "Think", "WeaponCleanupTimer", WeaponCleanupTimer ) function ToggleNoDroppedWeapon( ply ) if NoDroppedWeapons then NoDroppedWeapons = false ply:PrintMessage( HUD_PRINTCONSOLE, "NoDroppedWeapons disabled." ) else NoDroppedWeapons = true ply:PrintMessage( HUD_PRINTCONSOLE, "NoDroppedWeapons enabled." ) end end concommand.Add( "weapon_dropped_toggle", ToggleNoDroppedWeapon )[/lua] Put into autorun/server Fully tested and working, etc. About the module... I remember seeing it, and I know what you mean - I'm going to have a wee look for it in a second. Edit; Updated script, and found this - [URL]http://www.youtube.com/watch?v=EcH7RNGTKks[/URL]
Question, what's the weapon_dropped_toggle supposed to do?
[QUOTE=.\\Shadow};27825983]Question, what's the weapon_dropped_toggle supposed to do?[/QUOTE] Ah, I just added that wee bit for me :L It toggles weapons dropping at all, like when the npc dies they just disappear
Sorry, you need to Log In to post a reply to this thread.