hmm instead of openurl
just an example
browser = vgui.Create("HTML")
http.Fetch("url", function(b) browser:SetHTML(b) end))
not the best solution but it should work :)
[editline]4th October 2012[/editline]
also i just remembered i think UpdateHTMLMaterial is only needed if you are going to draw it manually
Well then both ways the panel was still blank and the html or url did not load.
whats your code?
[lua]-----------------------------------------
-----Made by JohnnyThunders (Loures)-----
-----------------------------------------
local FrameColor = Color(0, 0, 0, 0) --You can set your own frame color, remember to decrease the alpha value.
local ButtonColor = Color(0, 0, 0, 0) --You can set your own button color, remember to decrease the alpha value.
function OpenMOTDMenu()
local MenuFrame = vgui.Create("DFrame")
MenuFrame.OPaint = MenuFrame.Paint
MenuFrame:SetSize(ScrW() * 0.95, ScrH() * 0.95)
MenuFrame:SetPos((ScrW() - MenuFrame:GetWide()) / 2, (ScrH() - MenuFrame:GetTall()) / 2)
MenuFrame:SetTitle("Welcome to " .. GetHostName())
MenuFrame:SetVisible(true)
MenuFrame:SetDraggable(true)
MenuFrame:ShowCloseButton(true)
MenuFrame.Paint = function()
MenuFrame.OPaint(MenuFrame)
surface.SetDrawColor(Color(60, 60, 60, 255))
surface.DrawLine(1, MenuFrame:GetTall() - 27, MenuFrame:GetWide() - 1, MenuFrame:GetTall() - 27)
draw.RoundedBox( 6, 0, 1, MenuFrame:GetWide(), MenuFrame:GetTall() + 1, FrameColor )
end
MenuFrame:MakePopup()
local CloseButton = vgui.Create("DButton", MenuFrame)
CloseButton.OPaint = CloseButton.Paint
CloseButton:SetSize(150, 35)
CloseButton:SetPos(MenuFrame:GetWide() * 0.75, MenuFrame:GetTall() - 27 - CloseButton:GetTall()/2)
CloseButton:SetText("Ok, now let me play!")
CloseButton.Paint = function()
CloseButton.OPaint(CloseButton)
surface.SetDrawColor(ButtonColor)
surface.DrawRect(1, 1, CloseButton:GetWide() - 2, CloseButton:GetTall() - 2)
end
CloseButton.DoClick = function(button)
MenuFrame:Close()
end
local MenuPSheet = vgui.Create("DPropertySheet", MenuFrame)
MenuPSheet:SetPos(13, 30)
MenuPSheet:SetSize(MenuFrame:GetWide() - 25, MenuFrame:GetTall() - 84)
local Rules = vgui.Create( "HTML")
Rules:SetPos( 25, 50 )
Rules:SetSize( 250, 250 )
Rules:SetHTML([[<body scroll="yes">
<body background="http://op6.site.nfoservers.com/images/motd/background2.png">
<BODY BGCOLOR="black" TEXT="white">
<pre>
<img src="http://xenogamers.org/images/styles/ChitChat/style_blue/logo.png" />
<h1><b>You are playing on the xenoGamers Custom TTT!</b></h1>
<b>
<h2><b>Rules</b></h2>
1. No Microphone or Chat spam.
- This includes HLDJ and Other Languages. (English only!)
- Racism is against the rules.
2. No PropRDMing or pushing. This includes traitors.
3. No NSFW sprays. (No genitailia showing.)
4. No random death matching (RDMing).
5. Only a DETECTIVE's live-check can be deemed KOS if the person does not respond.
6. Do not hurt teammates, directly or indirectly, on purpose.
7. Metagaming and Ghosting is not allowed! You cannot question ghosted props.
8. If a ghosted prop rolls toward the a player, they cannot be considered a traitor.
9. No exploiting, glitching, or hacking.
10. No serious roleplaying in chat. JokeRP is allowed.
11. Keep your damn life to yourself. Nobody cares if you are a brony, furry, etc.
- If somebody asks you about your life that is fine. Don't go overboard.
- If you irritate other users then you are held responsible.
12. We are not afraid to mute you. Even if it does make the round, or two, unplayable.
13. Respect admins. They may not always be right but they try their best.
14. No harrassing other players. If a person violates rule 11 we will fix it... not you.
15. Broadcast to all players upon picking up a traitor weapon.
16. If a player says they are the traitor, that is not evidence for them being a traitor.
17. Give people a chance to ID bodies. Maybe the person he just killed was a traitor.
18. People with a sniper scoping around is not to be deemed suspicious. It is a sniper.
19. If somebody follows you. You must give them 3 text warnings. They must be 5 seconds between warning.
20. If somebody falls off a ledge and you are behind them. You are deemed responsible.
21. If an innocent plants a c4 and kills other innocents, no matter how many, it is considered mass-RDM.
22. If an innocent tries to defuse a bomb, without telling other innocents, and the bomb explodes, it is considered mass-RDM.
23. Rooms can be clamied when there is 6-4 people alive. When there are not 6-4 people alive, rooms are not to be claimed.
24. Names are to consist of english letters.
25. No duplicate names.
26. Impersonating another player is a bannable offense.
27. Do not have "Radio Names" (Nobody, Somebody in disguide, somebody, etc.)
28. Detectives cannot make new rules. They can perform orders.
- Not doing orders cannot make a player KOS.
- Orders don't have to be followed.
- They are allowed to ask for traitor weapons to be dropped for DNA.
- They are not allowed to take the traitor weapon.
29. Do not block other players, or doors/entrances. This rule applies with multiple doors to a room.
30. Do not traitor-bait. This means shooting randomly/ In the direction of the traitors.
<h2><b>Map Specific Rules</b></h2>
(Keep in mind, version numbers are excluded in these rules. Rules apply to all versions.)
CLUE
-Lights are NOT traitorous. However, spamming the lights is against the rules.
CRUMMYCRADLE
-Holding the Keycard for the trap room (The bathroom stall, not the one near the spawn) is traitorous.
WHITEHOUSE
-Opening the mines and moving them with more then 4 people alive is traitorous.
-Hiding in the robot room is against the rules.
LOST_TEMPLE
-When there is less then 7 people alive, traitors MUST leave the traitor rooms.
-Traitors are not allowed to camp in the traitor room. Don't stay in there too long.
-There must be atleast a minute for the traitor to be allowed to return to the room and not be camping.
THETHING
-Planting TNT is not traitorous.
-However, failing to warn other players of the planted TNT is traitorous. It can result in a slay aswell.
67THWAY
-Using props to break cars is fine. Do so as you please.
-Do not touch props to broken/frozen cars.
-Breaking the traitor tester is traitorous. Detectives will be slayed if they break it.
CANYON
-Shooting windows for no reason is bannable. The windows on that map lag when broken.
-You can only go to the bottom when it is being flooded.
ASSAULT, RICHLAND, AND TRAP MAPS.
-Glitching traps is bannable.
</b>
</font>
</pre>
</body>
</html>
]])
local GroupPage = vgui.Create("HTML")
GroupPage:SetPos( 25, 50 )
GroupPage:SetSize( 250, 250 )
GroupPage:OpenURL("http://xenogamers.org/forum.php")
local Donate = vgui.Create("HTML")
Donate:SetParent(MenuPSheet)
Donate:SetPos( 25, 50 )
Donate:SetSize( 250, 250 )
Donate:OpenURL("http://xenogamers.org/showthread.php?t=8920&p=86286#post86286"
local order = {}
order[1] = {"Rules", Rules, "gui/silkicons/page", false, false, "Rules are listed here"}
order[2] = {"Group Page", GroupPage, "gui/silkicons/group", false, false, "Group page here"}
order[3] = {"Donate", Donate, "gui/silkicons/heart", false, false, "Donations"}
for _, tab in pairs(order) do
MenuPSheet:AddSheet(unpack(tab))
end
end
concommand.Add("showmotdmenu", OpenMOTDMenu)[/lua]
.... why do you have 3 body tags?
thats most likely whats breaking it.
give me a mine ill redo it for you
[editline]4th October 2012[/editline]
few problems: you have a whole bunch of unstarted/unfinished tags and html doesnt take too kindly to that (XHTML atleast), the fact that you have 3 different bodies and you are only ending 1 and you have no start html tag
[editline]4th October 2012[/editline]
[code]
<html>
<head>
<style type = 'text/css'>
body{
background: "http://op6.site.nfoservers.com/images/motd/background2.png";
background-color: #000;
color: #FFF;
}
</style>
</head>
<body>
<img src="http://xenogamers.org/images/styles/ChitChat/style_blue/logo.png" />
<pre>
<h1>You are playing on the xenoGamers Custom TTT!</h1>
<h2>Rules</h2>
1. No Microphone or Chat spam.
- This includes HLDJ and Other Languages. (English only!)
- Racism is against the rules.
2. No PropRDMing or pushing. This includes traitors.
3. No NSFW sprays. (No genitailia showing.)
4. No random death matching (RDMing).
5. Only a DETECTIVE's live-check can be deemed KOS if the person does not respond.
6. Do not hurt teammates, directly or indirectly, on purpose.
7. Metagaming and Ghosting is not allowed! You cannot question ghosted props.
8. If a ghosted prop rolls toward the a player, they cannot be considered a traitor.
9. No exploiting, glitching, or hacking.
10. No serious roleplaying in chat. JokeRP is allowed.
11. Keep your damn life to yourself. Nobody cares if you are a brony, furry, etc.
- If somebody asks you about your life that is fine. Don't go overboard.
- If you irritate other users then you are held responsible.
12. We are not afraid to mute you. Even if it does make the round, or two, unplayable.
13. Respect admins. They may not always be right but they try their best.
14. No harrassing other players. If a person violates rule 11 we will fix it... not you.
15. Broadcast to all players upon picking up a traitor weapon.
16. If a player says they are the traitor, that is not evidence for them being a traitor.
17. Give people a chance to ID bodies. Maybe the person he just killed was a traitor.
18. People with a sniper scoping around is not to be deemed suspicious. It is a sniper.
19. If somebody follows you. You must give them 3 text warnings. They must be 5 seconds between warning.
20. If somebody falls off a ledge and you are behind them. You are deemed responsible.
21. If an innocent plants a c4 and kills other innocents, no matter how many, it is considered mass-RDM.
22. If an innocent tries to defuse a bomb, without telling other innocents, and the bomb explodes, it is considered mass-RDM.
23. Rooms can be clamied when there is 6-4 people alive. When there are not 6-4 people alive, rooms are not to be claimed.
24. Names are to consist of english letters.
25. No duplicate names.
26. Impersonating another player is a bannable offense.
27. Do not have "Radio Names" (Nobody, Somebody in disguide, somebody, etc.)
28. Detectives cannot make new rules. They can perform orders.
- Not doing orders cannot make a player KOS.
- Orders don't have to be followed.
- They are allowed to ask for traitor weapons to be dropped for DNA.
- They are not allowed to take the traitor weapon.
29. Do not block other players, or doors/entrances. This rule applies with multiple doors to a room.
30. Do not traitor-bait. This means shooting randomly/ In the direction of the traitors.
<h2><b>Map Specific Rules</b></h2>
(Keep in mind, version numbers are excluded in these rules. Rules apply to all versions.)
CLUE
-Lights are NOT traitorous. However, spamming the lights is against the rules.
CRUMMYCRADLE
-Holding the Keycard for the trap room (The bathroom stall, not the one near the spawn) is traitorous.
WHITEHOUSE
-Opening the mines and moving them with more then 4 people alive is traitorous.
-Hiding in the robot room is against the rules.
LOST_TEMPLE
-When there is less then 7 people alive, traitors MUST leave the traitor rooms.
-Traitors are not allowed to camp in the traitor room. Don't stay in there too long.
-There must be atleast a minute for the traitor to be allowed to return to the room and not be camping.
THETHING
-Planting TNT is not traitorous.
-However, failing to warn other players of the planted TNT is traitorous. It can result in a slay aswell.
67THWAY
-Using props to break cars is fine. Do so as you please.
-Do not touch props to broken/frozen cars.
-Breaking the traitor tester is traitorous. Detectives will be slayed if they break it.
CANYON
-Shooting windows for no reason is bannable. The windows on that map lag when broken.
-You can only go to the bottom when it is being flooded.
ASSAULT, RICHLAND, AND TRAP MAPS.
-Glitching traps is bannable.
</pre>
</body>
</html>
[/code]
[QUOTE=G4MB!T;37914096].... why do you have 3 body tags?
thats most likely whats breaking it.
give me a mine ill redo it for you
[editline]4th October 2012[/editline]
few problems: you have a whole bunch of unstarted/unfinished tags and html doesnt take too kindly to that (XHTML atleast), the fact that you have 3 different bodies and you are only ending 1 and you have no start html tag[/QUOTE]
It was working fine before the update but okay.
Anyone know what causes this error?
[lua][@lua/autorun/client/dlisttest.lua:40] bad key to string index (number expected, got string)[/lua]
Line in question:
[lua] DermaListView:AddLine(v.time, myImage, tostring(ply:Nick()), tostring(v.Desc), tostring(v.player:SteamID()))[/lua]
I thought it was SteamID because before I accidentally put ; instead of : but now I'm getting it and I don't know why.
The table holds this:
[lua]time = 21:18:58player = [Cow] King Recycleicon = icon16/connect.pngDesc = Has connected to the server.[/lua]This problem sometimes shows up and sometimes doesn't. It is being weird.
Apparently player is a string when it should be an entity.
perhaps the player is not valid at the time this is being called?
its been solved
[QUOTE=G4MB!T;37907538]eek too much code to look through
so far every problem related to lua that i have seen recently is because people are trying to use variables that do NOT exist.
unless you have defined ply as a global (which is a stupid idea on the server) it will not exist.
also im pretty sure Tick is client side so just use LocalPlayer() instead of ply[/QUOTE]
It's still not working for me.
I changed it to:
[lua]hook.Add( "Tick","ChangeBuildMode",function()
if ( LocalPlayer():KeyPressed( IN_WALK )) then ply:ConCommand("ChangeBuildMode") end
end)[/lua]
but I'm getting the error:
[code]ected screen resize - recreating fonts
Hook 'ChangeBuildMode' Failed: [gamemodes/test/gamemode/cl_init.lua:53] attempt to call method 'KeyPressed' (a nil value)
1. lua/includes/modules/hook.lua:83 (unknown)
[/code]
use LocalPlayer():KeyDown(KEY_W) or you could be super awesome and hook it into PlayerBindPressed on the client, that way people who dont use W for forward movement will still run the console command
-snip-
Fixed the problem
[QUOTE=ralle105;37906949]You do realise HUDPaint is called a lot faster than Think right?[/QUOTE]
Yes, sorry. I accidentally twisted it.
Im mucking around and customising some DarkRP. Ive added custom shipments etc, but Ive tried adding classess and all that happens and the 'Job' tab goes blank and no clasess appear in-game.
This is an example class code:
[CODE]TEAM_hitman = AddExtraTeam("Hitman", Color(153,0,255,255), "models/player/Phoenix.mdl", [[You kill the targets given to you.
You kill with stealth and precision. Only kill the targets paid for, do not abuse this class.]], {"ls_sniper", "weapon_glock", "weapon_tmp"}, "hitman", 2, 180, 0, false)[/CODE]
Anything wrong with that?
And Thats all Im adding into the shared.lua. Am I meant to be adding stuff somewhere else also or what?
[QUOTE=Blobtastic88;37919931]Im mucking around and customising some DarkRP. Ive added custom shipments etc, but Ive tried adding classess and all that happens and the 'Job' tab goes blank and no clasess appear in-game.
This is an example class code:
[CODE]TEAM_hitman = AddExtraTeam("Hitman", Color(153,0,255,255), "models/player/Phoenix.mdl", [[You kill the targets given to you.
You kill with stealth and precision. Only kill the targets paid for, do not abuse this class.]], {"ls_sniper", "weapon_glock", "weapon_tmp"}, "hitman", 2, 180, 0, false)[/CODE]
Anything wrong with that?
And Thats all Im adding into the shared.lua. Am I meant to be adding stuff somewhere else also or what?[/QUOTE]
Check the server's console, something is erroring.
Derp, should of looked for that earlier.
"[gamemodes\darkrp\gamemode\shared.lua:139] ')' expected (to close '(' at line 133) near 'TEAM_POLICE' "
Thats the error I was getting. I deleted "TEAM_POLICE" which fixed it. But now Im wondering how do I make it so you have to be a cop first, to then become another CP class?
Also, while Im here. Can someone edit this line so that only Gun dealers can spawn the weapon, but they still spawn in singles not shipments?
[CODE]AddCustomShipment("Desert eagle", "models/weapons/w_pist_deagle.mdl", "weapon_real_cs_desert_eagle", 500, 10, true, 550, true, {TEAM_GUN})[/CODE]
And one more thing, I added more classes etc, and they work but Im getting this constant error
[CODE][@lua\includes\extensions\table.lua:103] bad argument #1 to 'pairs' (table expected, got number)(Hook: HUDPaint)
[/CODE]
how do i play a sound after a sound has finished?
[QUOTE=RonanZer0;37921967]how do i play a sound after a sound has finished?[/QUOTE]
I don't think there's a way to detect when the sound is done playing
them how, in the stalker, did they add a sound to the end of each sound of the radio, i really wanna do that in hl2rp D:
[QUOTE=RonanZer0;37922065]them how, in the stalker, did they add a sound to the end of each sound of the radio, i really wanna do that in hl2rp D:[/QUOTE]
is stalker is open source go check
my guess is that they used timers
Nope.
[CODE]
local CLASS = {}
CLASS.DieSounds = {"npc/metropolice/die1.wav",
"npc/metropolice/die2.wav",
"npc/metropolice/die3.wav",
"npc/metropolice/die4.wav"}
CLASS.RadioEnd = {"npc/combine_soldier/vo/off1.wav",
"npc/combine_soldier/vo/off2.wav"}
CLASS.RadioStart = {"npc/metropolice/vo/off1.wav",
"npc/metropolice/vo/off4.wav"}
CLASS.Radio = {}
RADIO_CALM = 1
RADIO_ENGAGING = 2
RADIO_HURT = 3
RADIO_DEATH = 4
RADIO_WIN = 5
CLASS.Radio[ RADIO_CALM ] = {"npc/combine_soldier/vo/teamdeployedandscanning.wav",
"npc/combine_soldier/vo/stayalert.wav",
"npc/combine_soldier/vo/stayalertreportsightlines.wav",
"npc/combine_soldier/vo/confirmsectornotsterile.wav",
"npc/combine_soldier/vo/prepforcontact.wav",
"npc/combine_soldier/vo/readyweapons.wav",
"npc/combine_soldier/vo/reportallpositionsclear.wav",
"npc/combine_soldier/vo/stabilizationteamholding.wav",
"npc/combine_soldier/vo/reportallradialsfree.wav",
"npc/combine_soldier/vo/stayalert.wav",
"npc/combine_soldier/vo/noviscon.wav",
"npc/combine_soldier/vo/block31mace.wav",
"npc/combine_soldier/vo/block64jet.wav",
"npc/combine_soldier/vo/gridsundown46.wav",
"npc/combine_soldier/vo/flatline.wav",
"npc/combine_soldier/vo/lostcontact.wav",
"npc/combine_soldier/vo/fullactive.wav",
"npc/combine_soldier/vo/readyweapons.wav",
"npc/combine_soldier/vo/standingby].wav",
"npc/combine_soldier/vo/prepforcontact.wav",
"npc/combine_soldier/vo/sectionlockupdash4.wav",
"npc/combine_soldier/vo/reportingclear.wav",
"npc/combine_soldier/vo/sightlineisclear.wav",
"npc/combine_soldier/vo/targetone.wav",
"npc/combine_soldier/vo/movein.wav",
"npc/combine_soldier/vo/unitisinbound.wav",
"npc/metropolice/vo/code7.wav",
"npc/metropolice/vo/ptatlocationreport.wav",
"npc/metropolice/vo/responding2.wav",
"npc/metropolice/vo/unitisonduty10-8.wav",
"npc/metropolice/vo/investigating10-103.wav",
"npc/metropolice/vo/ten8standingby.wav",
"npc/metropolice/vo/ten97suspectisgoa.wav",
"npc/metropolice/vo/ten8standingby.wav",
"npc/metropolice/vo/nocontact.wav",
"npc/metropolice/vo/clearno647no10-107.wav",
"npc/metropolice/vo/holdingon10-14duty.wav",
"npc/metropolice/vo/404zone.wav",
"npc/metropolice/vo/stillgetting647e.wav",
"npc/metropolice/vo/anyonepickup647e.wav",
"npc/metropolice/vo/suspectlocationunknown.wav",
"npc/metropolice/vo/ptatlocationreport.wav",
"npc/metropolice/vo/unitis10-8standingby.wav",
"npc/metropolice/vo/preparefor1015.wav",
"npc/metropolice/vo/keepmoving.wav",
"npc/metropolice/vo/blockisholdingcohesive.wav",
"npc/metropolice/vo/dispupdatingapb.wav",
"npc/metropolice/vo/searchingforsuspect.wav",
"npc/metropolice/vo/nonpatrolregion.wav",
"npc/metropolice/vo/checkformiscount.wav",
"npc/metropolice/vo/stabilizationjurisdiction.wav",
"npc/metropolice/vo/allunitsreportlocationsuspect.wav",
"npc/metropolice/vo/transitblock.wav",
"npc/metropolice/vo/workforceintake.wav",
"npc/metropolice/vo/proceedtocheckpoints.wav",
"npc/metropolice/vo/holdthisposition.wav",
"npc/metropolice/vo/novisualonupi.wav",
"npc/metropolice/vo/ptgoagain.wav",
"npc/metropolice/vo/hardpointscanning.wav"}[/CODE]
how does he make it where it happen when the sound ends?
there is no way, that they spent months and months using timers for EVERY SINGLE COMBINE VOICE
and i see no timers in the entire file
i can post the WHOLE file if you want
[QUOTE=RonanZer0;37922189]Nope.
[CODE]
local CLASS = {}
CLASS.DieSounds = {"npc/metropolice/die1.wav",
"npc/metropolice/die2.wav",
"npc/metropolice/die3.wav",
"npc/metropolice/die4.wav"}
CLASS.RadioEnd = {"npc/combine_soldier/vo/off1.wav",
"npc/combine_soldier/vo/off2.wav"}
CLASS.RadioStart = {"npc/metropolice/vo/off1.wav",
"npc/metropolice/vo/off4.wav"}
CLASS.Radio = {}
RADIO_CALM = 1
RADIO_ENGAGING = 2
RADIO_HURT = 3
RADIO_DEATH = 4
RADIO_WIN = 5
CLASS.Radio[ RADIO_CALM ] = {"npc/combine_soldier/vo/teamdeployedandscanning.wav",
"npc/combine_soldier/vo/stayalert.wav",
"npc/combine_soldier/vo/stayalertreportsightlines.wav",
onpc/combine_soldier/vo/confirmsectornotsterile.wav",
"npc/combine_soldier/vo/prepforcontact.wav",
"npc/combine_soldier/vo/readyweapons.wav",
"npc/combine_soldier/vo/reportallpositionsclear.wav",
"npc/combine_soldier/vo/stabilizationteamholding.wav",
"npc/combine_soldier/vo/reportallradialsfree.wav",
"npc/combine_soldier/vo/stayalert.wav",
"npc/combine_soldier/vo/noviscon.wav",
"npc/combine_soldier/vo/block31mace.wav",
"npc/combine_soldier/vo/block64jet.wav",
"npc/combine_soldier/vo/gridsundown46.wav",
"npc/combine_soldier/vo/flatline.wav",
"npc/combine_soldier/vo/lostcontact.wav",
"npc/combine_soldier/vo/fullactive.wav",
"npc/combine_soldier/vo/readyweapons.wav",
"npc/combine_soldier/vo/standingby].wav",
"npc/combine_soldier/vo/prepforcontact.wav",
"npc/combine_soldier/vo/sectionlockupdash4.wav",
"npc/combine_soldier/vo/reportingclear.wav",
"npc/combine_soldier/vo/sightlineisclear.wav",
"npc/combine_soldier/vo/targetone.wav",
"npc/combine_soldier/vo/movein.wav",
"npc/combine_soldier/vo/unitisinbound.wav",
"npc/metropolice/vo/code7.wav",
"npc/metropolice/vo/ptatlocationreport.wav",
"npc/metropolice/vo/responding2.wav",
"npc/metropolice/vo/unitisonduty10-8.wav",
"npc/metropolice/vo/investigating10-103.wav",
"npc/metropolice/vo/ten8standingby.wav",
"npc/metropolice/vo/ten97suspectisgoa.wav",
"npc/metropolice/vo/ten8standingby.wav",
"npc/metropolice/vo/nocontact.wav",
"npc/metropolice/vo/clearno647no10-107.wav",
"npc/metropolice/vo/holdingon10-14duty.wav",
"npc/metropolice/vo/404zone.wav",
"npc/metropolice/vo/stillgetting647e.wav",
"npc/metropolice/vo/anyonepickup647e.wav",
"npc/metropolice/vo/suspectlocationunknown.wav",
"npc/metropolice/vo/ptatlocationreport.wav",
"npc/metropolice/vo/unitis10-8standingby.wav",
"npc/metropolice/vo/preparefor1015.wav",
"npc/metropolice/vo/keepmoving.wav",
"npc/metropolice/vo/blockisholdingcohesive.wav",
"npc/metropolice/vo/dispupdatingapb.wav",
"npc/metropolice/vo/searchingforsuspect.wav",
"npc/metropolice/vo/nonpatrolregion.wav",
"npc/metropolice/vo/checkformiscount.wav",
"npc/metropolice/vo/stabilizationjurisdiction.wav",
"npc/metropolice/vo/allunitsreportlocationsuspect.wav",
"npc/metropolice/vo/transitblock.wav",
"npc/metropolice/vo/workforceintake.wav",
"npc/metropolice/vo/proceedtocheckpoints.wav",
"npc/metropolice/vo/holdthisposition.wav",
"npc/metropolice/vo/novisualonupi.wav",
"npc/metropolice/vo/ptgoagain.wav",
"npc/metropolice/vo/hardpointscanning.wav"}[/CODE]
how does he make it where it happen when the sound ends?[/QUOTE]
you're missing the important part of that code. that isn't where he plays the sounds
[CODE]// base class
CLASS.WalkSpeed = 250
CLASS.CrouchedWalkSpeed = 0.5
CLASS.RunSpeed = 250
CLASS.DuckSpeed = 0.5
CLASS.JumpPower = 200
CLASS.PlayerModel = "models/player/police.mdl"
CLASS.DrawTeamRing = false
CLASS.CanUseFlashlight = true
CLASS.MaxHealth = 100
CLASS.StartHealth = 100
CLASS.TeammateNoCollide = false
CLASS.AvoidPlayers = false
CLASS.Utilities = { "weapon_ts_tripmines", "weapon_ts_medikit", "weapon_ts_flares", "Recharger", "Tracker" }
CLASS.UtilDescriptions = { "Tripmines that emit a loud alarm sound when unidentified lifeforms pass through them.",
"A medical kit that regenerates some of your health.",
"Flares that emit bright ultraviolet light.",
"A recharger that restores your flashlight batteries twice as fast.",
"Bullets that display a red dot on the radar when activated."}
function CLASS:Move( pl, mv )
if pl:KeyDown( IN_BACK ) then
mv:SetMaxSpeed( 150 )
end
end
function CLASS:Think( pl )
if not pl:Alive() then return end
if ( pl.BatteryTime or 0 ) < CurTime() then
pl.BatteryTime = CurTime() + 0.2
if pl:FlashlightIsOn() then
pl:AddBattery( -2 )
if pl:GetBattery() < 2 then
pl.BatteryTime = CurTime() + 1.0
pl:Flashlight( false )
end
else
if pl:GetNWBool( "Recharger", false ) then
pl:AddBattery( 2 )
else
pl:AddBattery( 1 )
end
end
end
if ( pl.WaitTime or 0 ) < CurTime() then
if ( pl.IdlePos or Vector(0,0,0) ):Distance( pl:GetPos() ) < 250 then
pl:SetRadioInfo( 1, RADIO_CALM )
end
pl.IdlePos = pl:GetPos()
pl.WaitTime = CurTime() + math.random(25,50)
end
local time, mode = pl:GetRadioInfo()
if time and time < CurTime() then
if time < ( pl.LastRadio or 0 ) then
pl:SetRadioInfo( pl.LastRadio, mode )
return
end
local snd = table.Random( self.Radio[ mode ] )
local waittime = SoundDuration( "../../hl2/sound/"..snd ) + 0.5
pl:SetRadioInfo()
pl:EmitSound( table.Random( self.RadioStart ), 100, math.random(90,110) )
pl.LastRadio = CurTime() + SoundDuration( snd ) + 1.0
timer.Simple( 0.3, function( pl, snd ) if ValidEntity( pl ) and pl:Alive() then pl:EmitSound( snd ) end end, pl, snd )
timer.Simple( waittime, function( pl ) if ValidEntity( pl ) and pl:Alive() then pl:EmitSound( table.Random( self.RadioEnd ), 100, math.random(90,110) ) end end, pl )
end
end
function CLASS:OnDeath( pl )
pl:EmitSound( Sound( table.Random( self.DieSounds ) ) )
for k,v in pairs( team.GetPlayers( TEAM_HUMAN ) ) do
if v:GetPos():Distance( pl:GetPos() ) < 500 and v != pl then
v:SetRadioInfo( CurTime() + math.Rand(0.5,3.5) , RADIO_DEATH )
end
end
end
function CLASS:OnSpawn( pl )
pl:SetNWBool( "Recharger", false )
pl:SetNWBool( "Tracker", false )
pl:SetNWBool( "IsTracking", false )
if string.find( pl:GetUtility(), "weapon" ) then
pl:Give( pl:GetUtility() )
else
pl:SetNWBool( pl:GetUtility(), true )
end
if pl:IsCommander() then
pl:SetHealth( 125 )
pl:SetModel( "models/player/combine_soldier.mdl" )
end
pl:SetCustomAmmo( "Pistol", 60 )
pl:SetCustomAmmo( "SMG", 250 )
pl:SetCustomAmmo( "Buckshot", 30 )
pl:SetCustomAmmo( "Rifle", 120 )
pl:SetCustomAmmo( "Burst", 120 )
pl:SetCustomAmmo( "Tripmine", 2 )
pl:SetCustomAmmo( "Flare", 1 )
pl:SetRadioInfo()
pl:SetBattery( 100 )
pl:SetNWBool( "Flashlight", false )
pl:SetColor( 255, 255, 255, 255 )
end
player_class.Register( "BaseSoldier", CLASS )
local CLASS ={}
CLASS.Base = "BaseSoldier"
CLASS.DisplayName = "SG 552"
CLASS.Description = "An accurate scoped automatic rifle."
function CLASS:Loadout( pl )
pl:Give( "weapon_ts_sg552" )
pl:Give( "weapon_ts_glock18" )
end
player_class.Register( "SG552", CLASS )
local CLASS ={}
CLASS.Base = "BaseSoldier"
CLASS.DisplayName = "FN P90"
CLASS.Description = "A submachine gun with a larger magazine and rate of fire."
function CLASS:Loadout( pl )
pl:Give( "weapon_ts_p90" )
pl:Give( "weapon_ts_usp" )
end
player_class.Register( "P90", CLASS )
local CLASS ={}
CLASS.Base = "BaseSoldier"
CLASS.DisplayName = "M3 Shotgun"
CLASS.Description = "A powerful semi-automatic shotgun."
function CLASS:Loadout( pl )
pl:Give( "weapon_ts_m3" )
pl:Give( "weapon_ts_p228" )
end
player_class.Register( "M3", CLASS )
local CLASS ={}
CLASS.Base = "BaseSoldier"
CLASS.DisplayName = "FAMAS G2"
CLASS.Description = "An automatic rifle that fires 3 shot bursts."
function CLASS:Loadout( pl )
pl:Give( "weapon_ts_famas" )
pl:Give( "weapon_ts_fiveseven" )
end
player_class.Register( "FAMAS", CLASS )[/CODE]
still cant see it :p
same lua file, skipped all the sound paths
really you are rating me dumb? the above looks like complete gibberish. and im not going to watch tutorials because they never help you with a specific thing its always o here look at the basics i already tried that.
GOOGLE.COM SEARCHING FOR 'how to play a sound after a sound has finish lua gmod' RESULTS: 0
[QUOTE=RonanZer0;37922246]...[/QUOTE]
[code]
local snd = table.Random( self.Radio[ mode ] )
local waittime = SoundDuration( "../../hl2/sound/"..snd ) + 0.5
pl:SetRadioInfo()
pl:EmitSound( table.Random( self.RadioStart ), 100, math.random(90,110) )
pl.LastRadio = CurTime() + SoundDuration( snd ) + 1.0
timer.Simple( 0.3, function( pl, snd ) if ValidEntity( pl ) and pl:Alive() then pl:EmitSound( snd ) end end, pl, snd )
timer.Simple( waittime, function( pl ) if ValidEntity( pl ) and pl:Alive() then pl:EmitSound( table.Random( self.RadioEnd ), 100, math.random(90,110) ) end end, pl )
[/code]
And how am i going to implent THAT into THIS:
(i dunno how to make functions :p im kind of nooby)
[CODE]function openAura.schema:AddVoice(faction, command, phrase, sound, female, menu)
self.voices[#openAura.schema.voices + 1] = {
command = command,
faction = faction,
phrase = phrase,
female = female,
sound = sound,
menu = menu
};
end;
-- A function to add a dispatch voice.
function openAura.schema:AddDispatchVoice(command, phrase, sound)
self.dispatchVoices[#openAura.schema.dispatchVoices + 1] = {
command = command,
phrase = phrase,
sound = sound
};
end;
openAura.schema.voices = {};
openAura.schema.menuVoices = {};
openAura.schema.dispatchVoices = {};
openAura.schema:AddDispatchVoice("Anti-Citizen", "Attention ground units. Anti-citizen reported in this community. Code: LOCK, CAUTERIZE, STABILIZE.", "npc/overwatch/cityvoice/f_anticitizenreport_spkr.wav");
openAura.schema:AddDispatchVoice("Anti-Civil", "Protection team alert. Evidence of anti-civil activity in this community. Code: ASSEMBLE, PLAN, CONTAIN.", "npc/overwatch/cityvoice/f_anticivilevidence_3_spkr.wav");
openAura.schema:AddDispatchVoice("Person Interest", "Attention please. Unidentified person of interest confirm your civil status with local protection team immediately.", "npc/overwatch/cityvoice/f_confirmcivilstatus_1_spkr.wav");
openAura.schema:AddDispatchVoice("Citizen Inaction", "Citizen reminder. Inaction is conspiracy. Report counter behaviour to a Civil Protection team immediately.", "npc/overwatch/cityvoice/f_innactionisconspiracy_spkr.wav");
openAura.schema:AddDispatchVoice("Unrest Structure", "Alert community ground protection units, local unrest structure detected. ASSEMBLE, ADMINISTER, PACIFY.", "npc/overwatch/cityvoice/f_localunrest_spkr.wav");
openAura.schema:AddDispatchVoice("Status Evasion", "Attention protection team. Status evasion in progress in this community. RESPOND, ISOLATE, ENQUIRE.", "npc/overwatch/cityvoice/f_protectionresponse_1_spkr.wav");
openAura.schema:AddDispatchVoice("Lockdown", "Attention all ground protection teams. Judgment waiver now in effect. Capital prosecution is discretionary.", "npc/overwatch/cityvoice/f_protectionresponse_5_spkr.wav");
openAura.schema:AddDispatchVoice("Rations Deducted", "Attention occupants. Your block is now charged with permissive inactive cohesion. Five ration units deducted.", "npc/overwatch/cityvoice/f_rationunitsdeduct_3_spkr.wav");
openAura.schema:AddDispatchVoice("Inspection", "Citizen notice. Priority identification check in progress. Please assemble in your designated inspection positions.", "npc/overwatch/cityvoice/f_trainstation_assemble_spkr.wav");
openAura.schema:AddDispatchVoice("Inspection 2", "Attention please. All citizens in local residential block, assume your inspection positions.", "npc/overwatch/cityvoice/f_trainstation_assumepositions_spkr.wav");
openAura.schema:AddDispatchVoice("Miscount Detected", "Attention resident. Miscount detected in your block. Co-operation with your Civil Protection team permit full ration reward.", "npc/overwatch/cityvoice/f_trainstation_cooperation_spkr.wav");
openAura.schema:AddDispatchVoice("Infection", "Attention resident. This block contains potential civil infection. INFORM, CO-OPERATE, ASSEMBLE.", "npc/overwatch/cityvoice/f_trainstation_inform_spkr.wav");
openAura.schema:AddDispatchVoice("Relocation", "Citizen notice. Failure to co-operate will result in permanent off-world relocation.", "npc/overwatch/cityvoice/f_trainstation_offworldrelocation_spkr.wav");
openAura.schema:AddDispatchVoice("Unrest Code", "Attention community. Unrest procedure code is now in effect. INOCULATE, SHIELD, PACIFY. Code: PRESSURE, SWORD, STERILIZE.", "npc/overwatch/cityvoice/f_unrestprocedure1_spkr.wav");
openAura.schema:AddDispatchVoice("Evasion", "Attention please. Evasion behaviour consistent with mal-compliant defendant. Ground protection team, alert. Code: ISOLATE, EXPOSE, ADMINISTER.", "npc/overwatch/cityvoice/f_evasionbehavior_2_spkr.wav");
openAura.schema:AddDispatchVoice("Individual", "Individual. You are charged with social endangerment, level one. Protection unit, prosecution code: DUTY, SWORD, MIDNIGHT.", "npc/overwatch/cityvoice/f_sociolevel1_4_spkr.wav");
openAura.schema:AddDispatchVoice("Autonomous", "Attention all ground protection teams. Autonomous judgement is now in effect, sentencing is now discretionary. Code: AMPUTATE, ZERO, CONFIRM.", "npc/overwatch/cityvoice/f_protectionresponse_4_spkr.wav");
openAura.schema:AddDispatchVoice("Citizenship", "Individual. You are convicted of multi anti-civil violations. Implicit citizenship revoked. Status: MALIGNANT.", "npc/overwatch/cityvoice/f_citizenshiprevoked_6_spkr.wav");
openAura.schema:AddDispatchVoice("Malcompliance", "Individual. You are charged with capital malcompliance, anti-citizen status approved.", "npc/overwatch/cityvoice/f_capitalmalcompliance_spkr.wav");
openAura.schema:AddDispatchVoice("Exogen", "Overwatch acknowledges critical exogen breach, AirWatch augmentation force dispatched and inbound. Hold for reinforcements.", "npc/overwatch/cityvoice/fprison_airwatchdispatched.wav");
openAura.schema:AddDispatchVoice("Failure", "Attention ground units. Mission failure will result in permanent off-world assignment. Code reminder: SACRIFICE, COAGULATE, PLAN.", "npc/overwatch/cityvoice/fprison_missionfailurereminder.wav");
openAura.schema:AddVoice("Combine", "Sweeping", "Sweeping for suspect.", "npc/metropolice/hiding02.wav");
openAura.schema:AddVoice("Combine", "Isolate", "Isolate!", "npc/metropolice/hiding05.wav");
openAura.schema:AddVoice("Combine", "You Can Go", "Alright, you can go.", "npc/metropolice/vo/allrightyoucango.wav");
openAura.schema:AddVoice("Combine", "Need Assistance", "Eleven-ninety-nine, officer needs assistance!", "npc/metropolice/vo/11-99officerneedsassistance.wav");
openAura.schema:AddVoice("Combine", "Administer", "Administer.", "npc/metropolice/vo/administer.wav");
openAura.schema:AddVoice("Combine", "Affirmative", "Affirmative.", "npc/metropolice/vo/affirmative.wav");
openAura.schema:AddVoice("Combine", "All Units Move In", "All units move in!", "npc/metropolice/vo/allunitsmovein.wav");
openAura.schema:AddVoice("Combine", "Amputate", "Amputate.", "npc/metropolice/vo/amputate.wav");
openAura.schema:AddVoice("Combine", "Anti-Citizen", "Anti-citizen.", "npc/metropolice/vo/anticitizen.wav");
openAura.schema:AddVoice("Combine", "Citizen", "Citizen.", "npc/metropolice/vo/citizen.wav");
openAura.schema:AddVoice("Combine", "Copy", "Copy.", "npc/metropolice/vo/copy.wav");
openAura.schema:AddVoice("Combine", "Cover Me", "Cover me, I'm going in!", "npc/metropolice/vo/covermegoingin.wav");
openAura.schema:AddVoice("Combine", "Assist Trespass", "Assist for a criminal trespass!", "npc/metropolice/vo/criminaltrespass63.wav");
openAura.schema:AddVoice("Combine", "Destroy Cover", "Destroy that cover!", "npc/metropolice/vo/destroythatcover.wav");
openAura.schema:AddVoice("Combine", "Don't Move", "Don't move!", "npc/metropolice/vo/dontmove.wav");
openAura.schema:AddVoice("Combine", "Final Verdict", "Final verdict administered.", "npc/metropolice/vo/finalverdictadministered.wav");
openAura.schema:AddVoice("Combine", "Final Warning", "Final warning!", "npc/metropolice/vo/finalwarning.wav");
openAura.schema:AddVoice("Combine", "First Warning", "First warning, move away!", "npc/metropolice/vo/firstwarningmove.wav");
openAura.schema:AddVoice("Combine", "Get Down", "Get down!", "npc/metropolice/vo/getdown.wav");
openAura.schema:AddVoice("Combine", "Get Out", "Get out of here!", "npc/metropolice/vo/getoutofhere.wav");
openAura.schema:AddVoice("Combine", "Suspect One", "I got suspect one here.", "npc/metropolice/vo/gotsuspect1here.wav");
openAura.schema:AddVoice("Combine", "Help", "Help!", "npc/metropolice/vo/help.wav");
openAura.schema:AddVoice("Combine", "Running", "He's running!", "npc/metropolice/vo/hesrunning.wav");
openAura.schema:AddVoice("Combine", "Hold It", "Hold it right there!", "npc/metropolice/vo/holditrightthere.wav");
openAura.schema:AddVoice("Combine", "Move Along Repeat", "I said move along.", "npc/metr
either stop trying with lua or start with something smaller.
is it really that hard years and years of very hard work i have to learn just to make a sound play after a sound? wow.
isnt this 'what do you need help with' and not 'if u dont know we wont help u o well *trollface*'
>.>
edit:
[IMG]http://www1.picturepush.com/photo/a/10693519/img/10693519.png[/IMG]
^^
and people say google is your friend
[QUOTE=RonanZer0;37922809]is it really that hard years and years of very hard work i have to learn just to make a sound play after a sound? wow.
isnt this 'what do you need help with' and not 'if u dont know we wont help u o well *trollface*'
>.>
edit:
[IMG]http://www1.picturepush.com/photo/a/10693519/img/10693519.png[/IMG]
^^
and people say google is your friend[/QUOTE]
I told you that you can use timers, quit bitching.
Sorry, you need to Log In to post a reply to this thread.