• Print

Author Topic: Last Help to Finish Zombie RP Project Version: 1.0  (Read 14595 times)

0 Members and 1 Guest are viewing this topic.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Last Help to Finish Zombie RP Project Version: 1.0
« on: June 09, 2012, 01:00:25 pm »
Hello Guys ! Finally i found a ( addon ) that CLEAN UP , DECALS ( BLOOD , ACID . ETC.. ) + ( CORPSES )

BUT THE ADDON IS A MENU THAT YOU JUST CLICK 2 BUTTOMS TO ( CLEAN UP EVERYTHING )



and this is the code:

Code: Lua
  1.  
  2. if CLIENT then
  3.         function VNUtilsClClCat(Panel)
  4.                 Panel:ClearControls()
  5.                 Panel:AddHeader()
  6.                
  7.                 local corpseclean = Panel:AddControl("DButton", {})
  8.                 corpseclean:SetText("Clean Corpses")
  9.                 corpseclean.DoClick = function()
  10.                         local props = ents.FindByClass("class C_ClientRagdoll")
  11.                         for k,v in pairs(props) do
  12.                                 v:Remove()
  13.                         end
  14.                 end
  15.                
  16.                 local decalclean = Panel:AddControl("DButton", {})
  17.                 decalclean:SetText("Clean Decals")
  18.                 decalclean.DoClick = function()
  19.                         RunConsoleCommand("r_cleardecals")
  20.                 end
  21.  
  22.         end
  23.  
  24.         function VNUtilsSvClCat(Panel)
  25.                 Panel:ClearControls()
  26.                 Panel:AddHeader()
  27.                
  28.                 local corpseclean = Panel:AddControl("DButton", {})
  29.                 corpseclean:SetText("Clean Corpses")
  30.                 if !LocalPlayer():IsAdmin() then corpseclean:SetEnabled(false) end
  31.                 corpseclean.DoClick = function()
  32.                         RunConsoleCommand("vn_fclearcorpse")
  33.                 end
  34.                
  35.                 local decalclean = Panel:AddControl("DButton", {})
  36.                 decalclean:SetText("Clean Decals")
  37.                 if !LocalPlayer():IsAdmin() then decalclean:SetEnabled(false) end
  38.                 decalclean.DoClick = function()
  39.                         RunConsoleCommand("vn_fcleardecals")
  40.                 end
  41.  
  42.         end
  43.  
  44.         function VNUtilsPop()
  45.                 spawnmenu.AddToolMenuOption("Utilities",
  46.                         "Corpse B Gone",  
  47.                         "VNUtilsSvClCat",  
  48.                         "Admin Clean",    "",    "",    
  49.                         VNUtilsSvClCat,
  50.                         {})
  51.                 spawnmenu.AddToolMenuOption("Utilities",
  52.                         "Corpse B Gone",  
  53.                         "VNUtilsClClCat",  
  54.                         "User Clean",    "",    "",    
  55.                         VNUtilsClClCat,
  56.                         {})
  57.         end
  58.         hook.Add("PopulateToolMenu", "VNUtilsPop", VNUtilsPop)
  59.  
  60.         local function VNUtils()       
  61.                 spawnmenu.AddToolCategory("Utilities", "Corpse B Gone", "Corpse B Gone")
  62.         end
  63.         hook.Add("AddToolMenuTabs", "VNUtils", VNUtils)
  64. else
  65.         AddCSLuaFile("corpsebgone.lua")
  66.        
  67.         function fcleardecals(pl, comm, args)
  68.                 if !pl:IsAdmin() then return end
  69.                
  70.                 for k, v in pairs(player.GetAll()) do
  71.                    v:ConCommand("r_cleardecals")
  72.                 end
  73.         end
  74.         concommand.Add("vn_fcleardecals", fcleardecals)
  75.        
  76.         function fclearcorpse(pl, comm, args)
  77.                 if !pl:IsAdmin() then return end
  78.                
  79.                 local temp = GetConVarNumber("g_ragdoll_maxcount")
  80.                 RunConsoleCommand("g_ragdoll_maxcount", "0")
  81.                 timer.Simple(1, RunConsoleCommand, "g_ragdoll_maxcount", tostring(temp))
  82.         end
  83.         concommand.Add("vn_fclearcorpse", fclearcorpse)
  84. end
  85.  
  86.  

Who can help me to Make This ( Clean up the corpses and decals ) automatic , every 5 - 10 minutes ? thanks !

Please help me , this is the last STEP of my ( zombie rp mod ) :D !

Thanks Ulysses =)

And Thanks Mr.President ( who help me with everything that i need ) =D ! im really happy with that :P

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #1 on: June 09, 2012, 02:37:53 pm »
Super easy if you want to do it this way. :)

I'm rewriting the addon for your specific use.. you can uninstall it if you wish.. though you don't have to..


Code: [Select]

function zModCleanup()

     local temp = GetConVarNumber( "g_ragdoll_maxcount" ) --stores max ragdoll count in memory for future use
     RunConsoleCommand( "g_ragdoll_maxcount", "0" ) -- Set's the server's ragdoll count to 0, thus removing all ragdolls from the map
     timer.Simple( 1, RunConsoleCommand, "g_ragdoll_maxcount", tostring( temp ) ) --resets the ragdoll count to the previous number

     for k, v in pairs( player.GetAll() ) do -- runs the following on all connected clients
          v:ConCommand( "r_cleardecals" ) -- r_cleardecals is a client console command to clear all decals. This removes all blood and bullet holes from the map's surfaces
     end

end
timer.Create( "zModCleanupTimer", 300, 0, zModCleanup ) --Puts the previous function on a timer... 300 seconds is 5 minutes. Change the 300 to be however many seconds you wish. 600 would be 10 minutes.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #2 on: June 09, 2012, 04:01:21 pm »
Working Perfect ( also was an option on the addon to ( delete the corpses when the zombies die ) :P !

Thanks Mr.President ! Again ! :)

( can you accept me on steam ;) i have something for you =) )

Thanks !

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #3 on: June 09, 2012, 07:23:24 pm »
Sure, when I go back to my tent I will.. I'm at work right now. No steam here. :P

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #4 on: June 09, 2012, 07:54:19 pm »
2 fast things

you remember the " antlionguard " that appear every 1600 seconds ... well

just a fast question about the sound:

Code: Lua
  1.      WorldSound( "tank.mp3", Vector( 0, 0, 0 ), 160, 100 )
  2. [/lua]
  3.  
  4. HOW TO INCREASE THE VOLUME ?
  5.  
  6. thanks :D

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #5 on: June 09, 2012, 08:43:08 pm »
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5627.html

Check out the wiki entry on the WorldSound function. If you can't answer that question yourself, let me know.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #6 on: June 09, 2012, 11:40:50 pm »
yes i got it :)

but one more question hehe... 1:

how i can introduce more spawn points on this code ?

Code: Lua
  1.  
  2. function EventFunction()
  3.      WorldSound( "tank.mp3", Vector( 0, 0, 75 ), 160, 100 )
  4.      local ent = ents.Create("npc_antlionguard")
  5.      ent:SetPos(Vector(1159,769,-607)) -- Change this to where you want the guard to spawn.
  6.      ent:Spawn() -- This method spawns the guard.
  7. end
  8. timer.Create("eventtimer", 1600, 0, EventFunction)
  9.  
  10.  

because if i create more of this code

Code: Lua
  1.      ent:SetPos(Vector(1159,769,-607))
  2.  

just spawn the first , also i test with this code and this

Code: Lua
  1.  
  2.      ent:SetPos(Vector(1159,769,-607)),
  3.  
  4.  

and the second thing , yesterday i was building another timer hehe :) to spawn Gas Cans over the MAP.

Code: Lua
  1.  
  2. function GascanFunction()
  3.          PrintMessage( HUD_PRINTTALK, "Gas cans have spawned around the map" )
  4.      local ent = ents.Create("ent_mad_fuel")
  5.      ent:SetPos(Vector(1184,-1175,-591))
  6.          ent:SetPos(Vector(-922,-1214,-591))
  7.      ent:SetPos(Vector(-137,-38,-591))
  8.      ent:SetPos(Vector(879,-271,-591))
  9.      ent:SetPos(Vector(1982,1221,-591))
  10.      ent:SetPos(Vector(749,1593,-591))
  11.      ent:SetPos(Vector(801,341,-591))
  12.          ent:SetPos(Vector(-244,1073,-591))
  13.      ent:SetPos(Vector(-518,1976,-591))
  14.      ent:SetPos(Vector(214,2603,-591))
  15.      ent:SetPos(Vector(-1066,-821,-591))
  16.      ent:SetPos(Vector(1175,-112,-591))
  17.      ent:Spawn()
  18. end
  19. timer.Create("eventtimer", 120, 0, GascanFunction)
  20.  
  21.  

and the same , i try to add all the spawn points and also test like this

Code: Lua
  1.  
  2. function GascanFunction()
  3.          PrintMessage( HUD_PRINTTALK, "Gas cans have spawned around the map" )
  4.      local ent = ents.Create("ent_mad_fuel")
  5.      ent:SetPos(Vector(1184,-1175,-591)),
  6.          ent:SetPos(Vector(-922,-1214,-591)),
  7.      ent:SetPos(Vector(-137,-38,-591)),
  8.      ent:SetPos(Vector(879,-271,-591)),
  9.      ent:SetPos(Vector(1982,1221,-591)),
  10.      ent:SetPos(Vector(749,1593,-591)),
  11.      ent:SetPos(Vector(801,341,-591)),
  12.          ent:SetPos(Vector(-244,1073,-591)),
  13.      ent:SetPos(Vector(-518,1976,-591)),
  14.      ent:SetPos(Vector(214,2603,-591)),
  15.      ent:SetPos(Vector(-1066,-821,-591)),
  16.      ent:SetPos(Vector(1175,-112,-591))
  17.      ent:Spawn()
  18. end
  19. timer.Create("eventtimer", 120, 0, GascanFunction)
  20.  
  21.  

and nothing ...

and the last thing... if you see the gas can code ( spawn all those cans every 120 seconds... but if nobody pick up the gas cans ... ( start overfloading the map ) .. so how i can make that before spawning the cans do something like this

Code: Lua
  1.  
  2.      local ent = ents.Delete("ent_mad_fuel")
  3.  
  4.  

i really dont know how to code something to delete the cans before spawning :)

Well that's all and Proyect ZombieRP Rev 1. Ready :D

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #7 on: June 10, 2012, 10:41:59 pm »
2 questions before I answer yours...


1. Are you trying to spawn antlion guards / gas cans at EVERY spawn point you identify or a random one from the list?

2. When the new gas cans spawn do you want all cans on the map to disappear first?

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #8 on: June 11, 2012, 10:29:04 am »
1. ( appear the antlionguard's on a random location ) and the gas cans on all locations that i put in the " lua "

2. delete all the cans from the map before spawning the news.

:D

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #9 on: June 11, 2012, 04:10:28 pm »
THIS POST IS IN REGARDS TO THE ANTLION GUARD SPAWNING
Code: [Select]
function EventFunction()
     local r = Math.random( 1, 10 ) -- the second number in this needs to be the total of possible spawn loctions for the guard
     local locs = { Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) } --add all the possible vectors here.. seperated with commas.
     WorldSound( "tank.mp3", Vector( 0, 0, 75 ), 160, 100 )
     local ent = ents.Create("npc_antlionguard")
     ent:SetPos(locs[r]) -- Change this to where you want the guard to spawn.
     ent:Spawn() -- This method spawns the guard.
end
timer.Create("eventtimer", 1600, 0, EventFunction)

if you want to kill the previous guard before spawning a new one... add this code to the function before any of the spawn code...

Code: [Select]
     local guards = ents.FindByClass("npc_antlionguard")
     for k, v in pairs( guards )
          v:Remove()
     end


if you just don't want the code to run if there is already a guard alive... put this code at the top of the function

Code: [Select]
     local guards = ents.FindByClass("npc_antlionguard")
     if #guards >= 1 then return end

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #10 on: June 11, 2012, 04:17:35 pm »
THIS CODE IS IN REGARDS TO THE FUEL CAN SPAWNING

Code: [Select]
function GascanFunction()
     PrintMessage( HUD_PRINTTALK, "Gas cans have spawned around the map" )
     local cans = ents.FindByClass( "ent_mad_fuel" )
     for k, v in pairs( cans )
          v:Remove()
     end
     local locs = { Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) , Vector(0,0,0) } --add all vectors here.. seperated with commas.
     for i=1, #locs do
          local ent = ents.Create("ent_mad_fuel")
          ent:SetPos(loc[i])
          ent:Spawn()
     end
end
timer.Create("eventtimer", 120, 0, GascanFunction)





I really hope those above 2 posts of code work for you.. if not, let me know what errors you get and I can try and work through it. I'm writing untested code from memory... some of it is bound to fail! :)

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #11 on: June 11, 2012, 04:52:07 pm »
hi president  well , i wait more than 6 minutes and this:

Code: Lua
  1. function GascanFunction()
  2.      PrintMessage( HUD_PRINTTALK, "Gas cans have spawned around the map" )
  3.      local cans = ents.FindByClass( "ent_mad_fuel" )
  4.      for k, v in pairs( cans )
  5.           v:Remove()
  6.      end
  7.      local locs = { Vector(-1402,929,-195) , Vector(523,1350,-195) , Vector(884,1945,-195) , Vector(-549,-455,-319) , Vector(366,-577,-319) , Vector(479,492,-447) , Vector(-609,1307,-445) , Vector(-962,1572,-447) , Vector(-1831,355,-879) , Vector(-1868,-2217,-879) , Vector(-1780,-1468,-682) , Vector(-544,-463,-319) , Vector(122,254,-375) , Vector(28,4164,-195) , Vector(2358,3682,-195) , Vector(3937,2211,-195) , Vector(3261,2040,-195) , Vector(4854,3632,-195) , Vector(3189,4248,-195) , Vector(-505,3698,-195) , Vector(-5,430,-195) , Vector(2359,893,-195) , Vector(2890,1941,-195) , Vector(2876,-1364,-195) , Vector(2137,-2393,-195) , Vector(-161,-659,-195) , Vector(1295,-1602,-195) , Vector(-166,-4615,-198) , Vector(-1791,-4674,-198) , Vector(-1810,-6895,-67) , Vector(-2927,-1353,-195) }
  8.      for i=1, #locs do
  9.           local ent = ents.Create("ent_mad_fuel")
  10.           ent:SetPos(loc[i])
  11.           ent:Spawn()
  12.      end
  13. end
  14. timer.Create("eventtimer", 120, 0, GascanFunction)
  15.  
  16.  

is not working , never appear the message and also the gas cans hehe.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #12 on: June 11, 2012, 05:41:52 pm »
What about the antlion spawn? Did that one work?

You should at least get the message.. are there any errors?

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #13 on: June 11, 2012, 05:47:08 pm »
nothing happend , ( its like the function doesn't exist )

* can you accept me in your steam buddies , its going to be more easy and also i have something for you :)

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Last Help to Finish Zombie RP Project Version: 1.0
« Reply #14 on: June 11, 2012, 05:57:32 pm »
I did accept you on steam.. but I am in Afghanistan at work currently. I don't have access to steam chat and usually keep my steam in offline mode to prevent my games from trying to update on my crappy internet out here.

  • Print