• how can i add Musice in flood?
    18 replies, posted
I want add build time FIGHT TIME and EndTime Playsound in flood 13 but.. it was hard I add this code but.. this code error in flood 13 gamemode link is here [url]http://www.garrysmod.org/downloads/?a=view&id=133211[/url] i want add playsound in gmod flood 13 plseas teach for me...
[url]http://wiki.garrysmod.com/page/Libraries/sound/Play[/url]
i can't understand.. please teach full sound.
Anywon? I beed help somebody help me please
[QUOTE=rlarlgus99;39077252]i can't understand.. please teach full sound.[/QUOTE] please teach full english.
The link LedZepp linked should work fine for "full sound". Are you trying to loop a sound/song? [B]EDIT:[/B] Maybe this would help: [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index06b4.html#Looping_Sounds"]link[/URL]
[QUOTE=Siniq;39084020]please teach full english.[/QUOTE] Sry i can speak english little;; I want Play music Build time sound Fight time sound and Round restart sound. Maybe Build sound end With sound end and go fight time sound and fight sound end with fight sound end Start Round end sound.. please teach me... sry i am lua noob [editline]3rd January 2013[/editline] [QUOTE=willaume;39084081]The link LedZepp linked should work fine for "full sound". Are you trying to loop a sound/song? [B]EDIT:[/B] Maybe this would help: [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index06b4.html#Looping_Sounds"]link[/URL][/QUOTE] sry this is not i want. Sry i can speak english little;; I want Play music Build time sound Fight time sound and Round restart sound. Maybe Build sound end With sound end and go fight time sound and fight sound end with fight sound end Start Round end sound.. please teach this full code me... sry i am lua noob
Listen dude unless you try I can't really help you. Show me that you actually made a SMALL attempt then ill do it for you
i give init full code maybe you need all code i add your steam friend AddCSLuaFile("shared.lua") AddCSLuaFile("cl_HUDS.lua") AddCSLuaFile("cl_HUD.lua") AddCSLuaFile("cl_Menu.lua") AddCSLuaFile("cl_Score.lua") AddCSLuaFile("cl_init.lua") include("shared.lua") include("PP.lua") include("CS.lua") include("Players.lua") -- Serverside olny stuff goes here BV = 320 -- Time to building boats FV = 15 -- Time for water to fill FIV = 300 -- Time to Fight RV = 30 -- Time after fight WP = 1 PS = 5 CS = 60 function GM:Initialize() TimerStatus = 1 BuildTime = BV FloodTime = FV FightTime = FIV ReflectTime = RV if file.Exists( "FloodBans/ans.txt", "DATA" ) then BanTable = util.KeyValuesToTable(file.Read( "FloodBans/Bans.txt", "DATA" )) print("=======================================") print("============Ban file loaded============") print("=======================================") else BanTable = {} file.Write("FloodBans/Bans.txt", util.TableToKeyValues(BanTable)) print("======================================") print("===========Ban file created===========") print("======================================") end umsg.Start( "TehTimerzAlive" ) umsg.Long( TimerStatus ) umsg.End() umsg.Start( "BuildIt" ) umsg.Long( BuildTime ) umsg.End() umsg.Start( "FloodIt" ) umsg.Long( FloodTime ) umsg.End() umsg.Start( "FightIt" ) umsg.Long( FightTime ) umsg.End() umsg.Start( "ReflectIt" ) umsg.Long( ReflectTime ) umsg.End() timer.Create("TimeWarp", 1, 0, TimeWarp) end function TimeWarp() umsg.Start( "TehTimerzAlive" ) umsg.Long( TimerStatus ) umsg.End() umsg.Start( "BuildIt" ) umsg.Long( BuildTime ) umsg.End() umsg.Start( "FloodIt" ) umsg.Long( FloodTime ) umsg.End() umsg.Start( "FightIt" ) umsg.Long( FightTime ) umsg.End() umsg.Start( "ReflectIt" ) umsg.Long( ReflectTime ) umsg.End() SuperAdmin = "STEAM_0:1:23312436"-- Owner Setting if TimerStatus == 1 then -- Time to building boats BuildTimeFunc() elseif TimerStatus == 2 then -- Time for water to fill FloodTimeFunc() elseif TimerStatus == 3 then -- Time to Fight FightTimeFunc() elseif TimerStatus == 4 then -- Time after fight ReflectTimeFunc() end end BTools = { "camera", "dynamite", "emitter", "example", "eyeposer", "faceposer", "finger", "hoverball", "ignite", "inflator", "leafblower", "magnetise", "pulley", "rtcamera", "spawner", "statue", "turret", "lamp", "light", } STools = { "ballsocket_adv", "material", "paint", "physprop", "wheel", "colour", "nail", "remover" } function GM:CanTool(pl, tr, tool) if table.HasValue(BTools, tool) || table.HasValue(STools, tool) then if table.HasValue(BTools, tool) then if pl:SteamID() == FindMe || pl:SteamID() == FindMe1 then return true else return false end end if tr.Entity:IsWorld() then return false elseif !tr.Entity:IsValid() then return false elseif tr.Entity:GetNetworkedEntity("Owner") != pl then return false else if table.HasValue(STools, tool) then if pl:IsAdmin() then return true else if tool == "remover" then pl:ChatPrint("Use the \"Remover Tool\" to remove props, this is the remover(Admins only)") return false else pl:ChatPrint("This tool is vip+ only, check the donations page in the Q menu on how to get it.") return false end end end end else return true end end function BuildTimeFunc() -- Time to building boats if BuildTime <= 0 then ResetHealth() TimerStatus = 2 RemoveAllWeapons() UnfreezeProps() BuildTime = BV else BuildTime = (BuildTime - 1) end end function FloodTimeFunc() -- Time for water to fill if FloodTime <= 0 then TimerStatus = 3 RaiseWater() RemoveAllWeapons() GivePistols() UnfreezeProps() FloodTime = FV else FloodTime = (FloodTime - 1) end end function FightTimeFunc() -- Time to Fight if FightTime <= 0 then TimerStatus = 4 Teams = false LowerWater() RemoveAllWeapons() GivePhysGuns() RecieveBonus() ResetHealth() FightTime = FIV else FightTime = FightTime - 1 PayDay() end end function ReflectTimeFunc() -- Time after fight if ReflectTime <= 0 then TimerStatus = 1 ReflectTime = RV else ReflectTime = ReflectTime - 1 RefundProps() end end function RaiseWater() for k, v in pairs(ents.FindByName("water")) do v:Fire("Open","",0) end end function LowerWater() for k, v in pairs(ents.FindByName("water")) do v:Fire("Close","",0) end end function GM:EntityTakeDamage( ent, dmginfo ) local infl = dmginfo:GetInflictor() local attacker = dmginfo:GetAttacker() local amount = dmginfo:GetDamage() if TimerStatus == 1 or TimerStatus == 4 then return false else if ent:IsPlayer() then --Rawr else if attacker:IsPlayer() then if attacker:GetActiveWeapon() != NULL then if attacker:GetActiveWeapon():GetClass() == "weapon_pistol" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 2) elseif attacker:GetActiveWeapon():GetClass() == "weapon_crossbow" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 8) elseif attacker:GetActiveWeapon():GetClass() == "weapon_rpg" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 65) elseif attacker:GetActiveWeapon():GetClass() == "weapon_deagle" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 5) elseif attacker:GetActiveWeapon():GetClass() == "weapon_357" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 4) elseif attacker:GetActiveWeapon():GetClass() == "weapon_tmp" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 3) elseif attacker:GetActiveWeapon():GetClass() == "weapon_supergrav_gun" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 1) elseif attacker:GetActiveWeapon():GetClass() == "weapon_mp5" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 2) elseif attacker:GetActiveWeapon():GetClass() == "weapon_m4" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 3) elseif attacker:GetActiveWeapon():GetClass() == "weapon_ak47" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 5) elseif attacker:GetActiveWeapon():GetClass() == "weapon_crowbar" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 7) elseif attacker:GetActiveWeapon():GetClass() == "weapon_stunstick" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") + 2) elseif attacker:GetActiveWeapon():GetClass() == "weapon_para" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 2) elseif attacker:GetActiveWeapon():GetClass() == "weapon_pumpshotgun" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 5) elseif attacker:GetActiveWeapon():GetClass() == "weapon_frag" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 16) elseif attacker:GetActiveWeapon():GetClass() == "weapon_glock" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 2.5) elseif attacker:GetActiveWeapon():GetClass() == "weapon_solarlaser" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 0.5) elseif attacker:GetActiveWeapon():GetClass() == "weapon_m24sd" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 22) elseif attacker:GetActiveWeapon():GetClass() == "weapon_fiveseven" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 2) elseif attacker:GetActiveWeapon():GetClass() == "weapon_solarlaser2" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 1.5) elseif attacker:GetActiveWeapon():GetClass() == "weapon_solarlaser3" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 1.6) elseif attacker:GetActiveWeapon():GetClass() == "weapon_smg1" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 1.5) end end else if
wrap that up in [noparse][code][/code][/noparse] tags
Get that naked code out of my face, for god's sake get some lua tags round it straight away!
Like this: [noparse][code] blah blah blah my code goes here [/code][/noparse]
Alright fine... If you really are that lazy and not confident then ill do it. Besides I did it on my flood an it works fine. Just wait for me to get home. Anyway what is your first language.
[QUOTE=LedZepp;39091934]Alright fine... If you really are that lazy and not confident then ill do it. Besides I did it on my flood an it works fine. Just wait for me to get home. Anyway what is your first language.[/QUOTE] Thanks ... I love you :D [editline]4th January 2013[/editline] [QUOTE=LedZepp;39091934]Alright fine... If you really are that lazy and not confident then ill do it. Besides I did it on my flood an it works fine. Just wait for me to get home. Anyway what is your first language.[/QUOTE] My first language is Korean but If you confident setting english.. sry i can english little [editline]4th January 2013[/editline] [QUOTE=LedZepp;39091934]Alright fine... If you really are that lazy and not confident then ill do it. Besides I did it on my flood an it works fine. Just wait for me to get home. Anyway what is your first language.[/QUOTE] Sry.. i have One question one.. it was simple but.. i don't know gmod 13 code Can you edit gmod 10 code? this is simpe prop protetion..
:suicide:
[QUOTE=Siniq;39084020]please teach full english.[/QUOTE] You don't need to be an ass. Obviously english isn't his first language. He is Korean.
[QUOTE=Gamz365;39092234]You don't need to be an ass. Obviously english isn't his first language. He is Korean.[/QUOTE] Agreed. And still I remember when I started LUA. I asked for help often but now after a year it seems fairly easy. I feel the best way to learn is to read other codes and think of the logic
[QUOTE=LedZepp;39093101]Agreed. And still I remember when I started LUA. I asked for help often but now after a year it seems fairly easy. I feel the best way to learn is to read other codes and think of the logic[/QUOTE] ...? I can't understand...
[lua] AddCSLuaFile("shared.lua") AddCSLuaFile("cl_HUDS.lua") AddCSLuaFile("cl_Menu.lua") AddCSLuaFile("cl_Score.lua") AddCSLuaFile("cl_init.lua") include("shared.lua") include("PP.lua") include("CS.lua") include("Players.lua") -- Serverside olny stuff goes here BV = 25 -- Time to building boats FV = 10 -- Time for water to fill FIV = 720 -- Time to Fight RV = 15 -- Time after fight WP = 1 PS= 5 CS = 60 function GM:Initialize() TimerStatus = 1 BuildTime = BV FloodTime = FV FightTime = FIV ReflectTime = RV if file.Exists( "FloodBans/ans.txt", "DATA" ) then BanTable = util.KeyValuesToTable(file.Read( "FloodBans/Bans.txt", "DATA" )) print("=======================================") print("============Ban file loaded============") print("=======================================") else BanTable = {} file.Write("FloodBans/Bans.txt", util.TableToKeyValues(BanTable)) print("======================================") print("===========Ban file created===========") print("======================================") end umsg.Start( "TehTimerzAlive" ) umsg.Long( TimerStatus ) umsg.End() umsg.Start( "BuildIt" ) umsg.Long( BuildTime ) umsg.End() umsg.Start( "FloodIt" ) umsg.Long( FloodTime ) umsg.End() umsg.Start( "FightIt" ) umsg.Long( FightTime ) umsg.End() umsg.Start( "ReflectIt" ) umsg.Long( ReflectTime ) umsg.End() timer.Create("TimeWarp", 1, 0, TimeWarp) end function TimeWarp() umsg.Start( "TehTimerzAlive" ) umsg.Long( TimerStatus ) umsg.End() umsg.Start( "BuildIt" ) umsg.Long( BuildTime ) umsg.End() umsg.Start( "FloodIt" ) umsg.Long( FloodTime ) umsg.End() umsg.Start( "FightIt" ) umsg.Long( FightTime ) umsg.End() umsg.Start( "ReflectIt" ) umsg.Long( ReflectTime ) umsg.End() FindMe = "" --Owner SteamID FindMe1 = "" --Owner SteamID if TimerStatus == 0 then -- Time to building boats PlayersReadyCheck() elseif TimerStatus == 1 then -- Time to building boats BuildTimeFunc() elseif TimerStatus == 2 then -- Time for water to fill FloodTimeFunc() elseif TimerStatus == 3 then -- Time to Fight FightTimeFunc() elseif TimerStatus == 4 then -- Time after fight ReflectTimeFunc() end end BTools = { "camera", "dynamite", "emitter", "example", "eyeposer", "faceposer", "finger", "hoverball", "ignite", "inflator", "leafblower", "magnetise", "pulley", "rtcamera", "spawner", "statue", "turret", "lamp", "light",} STools = { "ballsocket_adv", "material", "paint", "physprop", "wheel", "colour", "nail", "thruster", "remover"} function GM:CanTool(pl, tr, tool) if table.HasValue(BTools, tool) || table.HasValue(STools, tool) then if table.HasValue(BTools, tool) then if pl:SteamID() == FindMe || pl:SteamID() == FindMe1 then return true else return false end end if tr.Entity:IsWorld() then return false elseif !tr.Entity:IsValid() then return false elseif tr.Entity:GetNetworkedEntity("Owner") != pl then return false else if table.HasValue(STools, tool) then if pl:IsAdmin() then return true else if tool == "remover" then pl:ChatPrint("Use the \"Remover Tool\" to remove props, this is the remover(Admins only)") return false else pl:ChatPrint("This tool is vip+ only, check the donations page in the Q menu on how to get it.") return false end end end end else return true end end function PlayersReadyCheck() ReadyPlayers = 0 for k, v in pairs(player.GetAll()) do if v.Ready then ReadyPlayers = ReadyPlayers + 1 if ReadyPlayers > 1 then return true end end end end function BuildTimeFunc() -- Time to building boats if BuildTime <= 0 then ResetHealth() BuildMusic() TimerStatus = 2 RemoveAllWeapons() UnfreezeProps() BuildTime = BV else BuildTime = (BuildTime - 1) end end function FloodTimeFunc() -- Time for water to fill if FloodTime <= 0 then TimerStatus = 3 RaiseWater() StopMusic() FightMusic() DisableTeleport() RemoveAllWeapons() GivePistols() UnfreezeProps() FloodTime = FV else FloodTime = (FloodTime - 1) end end function FightTimeFunc() -- Time to Fight if FightTime <= 0 then TimerStatus = 4 Teams = false LowerWater() RemoveAllWeapons() GivePhysGuns() RecieveBonus() ResetHealth() FightTime = FIV else FightTime = FightTime - 1 PayDay() end end function ReflectTimeFunc() -- Time after fight if ReflectTime <= 0 then TimerStatus = 1 ReflectTime = RV StopMusic() EndMusic() else ReflectTime = ReflectTime - 1 RefundProps() end end function RaiseWater() for k, v in pairs(ents.FindByName("water")) do v:Fire("Open","",0) end end function FightMusic() local vPos = Vector(-20.653313, -504.766937, 1200.695923) sound.Play("put your song here", vPos, 150, 100, 1) // SONG GOES HERE!! end function BuildMusic() local vPos = Vector(-20.653313, -504.766937, 1200.695923) sound.Play("put your song here", vPos, 150, 100, 1) // SONG GOES HERE!! end function EndMusic() local vPos = Vector(-20.653313, -504.766937, 1200.695923) sound.Play("put your song here", vPos, 150, 100, 1) // SONG GOES HERE!! end function StopMusic() RunConsoleCommand("stopsound") end function LowerWater() for k, v in pairs(ents.FindByName("water")) do v:Fire("Close","",0) end end function GM:EntityTakeDamage( ent, dmginfo ) local infl = dmginfo:GetInflictor() local attacker = dmginfo:GetAttacker() local amount = dmginfo:GetDamage() if TimerStatus == 1 or TimerStatus == 4 then return false else if ent:IsPlayer() then --Rawr else if attacker:IsPlayer() then if attacker:GetActiveWeapon() != NULL then if attacker:GetActiveWeapon():GetClass() == "weapon_pistol" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 1) elseif attacker:GetActiveWeapon():GetClass() == "weapon_crossbow" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 10) elseif attacker:GetActiveWeapon():GetClass() == "weapon_rpg" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 30) elseif attacker:GetActiveWeapon():GetClass() == "weapon_deagle" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 3) elseif attacker:GetActiveWeapon():GetClass() == "weapon_357" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 4) elseif attacker:GetActiveWeapon():GetClass() == "weapon_tmp" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 3) end end else if attacker:GetClass() == "entityflame" then ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - .5) else ent:SetNWInt("PropHealth", ent:GetNWInt("PropHealth") - 1) end end if ent:GetNWInt("PropHealth") <= 0 and ent:IsValid() then ent:Remove() end end end end function GM:Think() if PlayersReadyCheck() then if TimerStatue == 3 then timer.Simple(10, function() if pl:HasWeapon("gmod_tool") || pl:HasWeapon("weapon_physgun") then RemoveAllWeapons() GivePistols() end end) end end SaveProfile() FoundWinner() umsg.Start( "TehTimerzAlive" ) umsg.Long( TimerStatus ) umsg.End() end [/lua]
Sorry, you need to Log In to post a reply to this thread.