• What do you need help with V4
    639 replies, posted
How to fix it?
[QUOTE=Spencer Sharkey;35200055]Rotated text anyone? Didn't find any functions for it, although I thought there was one. Would it be feasible to render text to a render target then draw a rotated textured quad? Or does it not have alpha.. hmm.[/QUOTE] I saw the "rotated text anyone" and was about to suggest rendering the text to an RT, then drawing the RT as a rotated quad / rect, but apparently you thought the same thing. That'd be my first attempt, but if I remember correctly, RTs work differently in gmod than then do in LOVE 2D. In LOVE 2D, that'd be the way you do it, though. :v:
[QUOTE=Spencer Sharkey;35200055]Rotated text anyone? Didn't find any functions for it, although I thought there was one. Would it be feasible to render text to a render target then draw a rotated textured quad? Or does it not have alpha.. hmm.[/QUOTE] Wizard of Ass found a way to do it without render targets. [QUOTE=Wizard of Ass;32614030]Rotated text, finally got that done. [lua] local sSetTextPos = surface.SetTextPos; local sDrawText = surface.DrawText; local cPushModelMatrix = cam.PushModelMatrix; local cPopModelMatrix = cam.PopModelMatrix; local mat = Matrix(); local matAng = Angle(0, 0, 0); local matTrans = Vector(0, 0, 0); local matScale = Vector(0, 0, 0); local function drawSpecialText(txt, posX, posY, scaleX, scaleY, ang) matAng.y = ang; mat:SetAngle(matAng); matTrans.x = posX; matTrans.y = posY; mat:SetTranslation(matTrans); matScale.x = scaleX; matScale.y = scaleY; mat:Scale(matScale); sSetTextPos(0, 0); cPushModelMatrix(mat); sDrawText(txt); cPopModelMatrix(); end[/lua] (Yes I also have a version where it draws centered.)[/QUOTE]
[QUOTE=Jvs;35208119]Wizard of Ass found a way to do it without render targets.[/QUOTE] Thanks :) Makes sense. Now, would surface.DrawTexturedRectUV() allow me to cut certain pieces out of larger textures and only draw, say, a small box from it? Or is that another function. example: rendering a sprite from a sprite sheet.
I could use a hand if someone can help. I've been trying to make an rpg that shoots a large bomb, and I used the SWEP Construction Kit made by Clavus. Does anybody know how to remove the added elements on primary fire, and create them again on reload? Here's a pastebin of the swep code. Thanks guys. [URL="http://pastebin.com/1b1aUGwY"]http://pastebin.com/1b1aUGwY[/URL]
How can I make an entity move in a direction depending on its angle? This works, but only 70% of the time [lua] local angles=ent:GetAngles() angles=angles-Angle(270,0,0) local dir=angles:Forward() * speed phys:ApplyForceCenter( dir ) [/lua] It will at random times change the direction it goes in, instead of forward it goes backwards.
Try this [lua] local angles=ent:GetAngles() angles:RotateAroundAxis(angles:Right(),270) local dir=angles:Forward() * speed phys:ApplyForceCenter( dir ) [/lua]
thank you worked like a charm
[lua] resource.AddFile("sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-11-Omen.mp3") resource.AddFile("sound/ttt/Inno-Zeph-12-BloodSugar.mp3") resource.AddFile("sound/ttt/Inno-Zeph-13-Lullaby1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-14-Lullaby2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3") resource.AddFile("sound/ttt/Inno-Zeph-18-Iridescent.mp3") resource.AddFile("sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3") resource.AddFile("sound/ttt/Inno-Zeph-3-ParadiseCity.mp3") resource.AddFile("sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3") resource.AddFile("sound/ttt/Inno-Zeph-5-CominInHot.mp3") resource.AddFile("sound/ttt/Inno-Zeph-6-RunToTheHills.mp3") resource.AddFile("sound/ttt/Inno-Zeph-7-Shots.mp3") resource.AddFile("sound/ttt/Inno-Zeph-8-BottomsUp.mp3") resource.AddFile("sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-11-Omen.mp3") resource.AddFile("sound/ttt/Inno-Zeph-12-BloodSugar.mp3") resource.AddFile("sound/ttt/Inno-Zeph-13-Lullaby1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-14-Lullaby2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3") resource.AddFile("sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3") resource.AddFile("sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3") resource.AddFile("sound/ttt/Inno-Zeph-18-Iridescent.mp3") resource.AddFile("sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3") resource.AddFile("sound/ttt/Inno-Zeph-3-ParadiseCity.mp3") resource.AddFile("sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3") resource.AddFile("sound/ttt/Inno-Zeph-5-CominInHot.mp3") resource.AddFile("sound/ttt/Inno-Zeph-6-RunToTheHills.mp3") resource.AddFile("sound/ttt/Inno-Zeph-7-Shots.mp3") resource.AddFile("sound/ttt/Inno-Zeph-8-BottomsUp.mp3") resource.AddFile("sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3") resource.AddFile("sound/ttt/Trait-Zeph-1-HighwayToHell.mp3") resource.AddFile("sound/ttt/Trait-Zeph-10-Burn.mp3") resource.AddFile("sound/ttt/Trait-Zeph-11-Monster.mp3") resource.AddFile("sound/ttt/Trait-Zeph-12-DangerZone.mp3") resource.AddFile("sound/ttt/Trait-Zeph-13-RaiseALittleHell.mp3") resource.AddFile("sound/ttt/Trait-Zeph-14-CantTouchThis.mp3") resource.AddFile("sound/ttt/Trait-Zeph-15-MidnightQueen.mp3") resource.AddFile("sound/ttt/Trait-Zeph-16-BloodOnMyHands.mp3") resource.AddFile("sound/ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3") resource.AddFile("sound/ttt/Trait-Zeph-18-ChaChing.mp3") resource.AddFile("sound/ttt/Trait-Zeph-2-CrazyTrain.mp3") resource.AddFile("sound/ttt/Trait-Zeph-3-Glory.mp3") resource.AddFile("sound/ttt/Trait-Zeph-4-Tendencies.mp3") resource.AddFile("sound/ttt/Trait-Zeph-5-BleedItOut.mp3") resource.AddFile("sound/ttt/Trait-Zeph-6-Battery.mp3") resource.AddFile("sound/ttt/Trait-Zeph-7-RideTheLightning.mp3") resource.AddFile("sound/ttt/Trait-Zeph-8-MasterOfPuppets.mp3") resource.AddFile("sound/ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3") local songs = { "sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3" "sound/ttt/Inno-Zeph-11-Omen.mp3" "sound/ttt/Inno-Zeph-12-BloodSugar.mp3" "sound/ttt/Inno-Zeph-13-Lullaby1.mp3" "sound/ttt/Inno-Zeph-14-Lullaby2.mp3" "sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3" "sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3" "sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3" "sound/ttt/Inno-Zeph-18-Iridescent.mp3" "sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3" "sound/ttt/Inno-Zeph-3-ParadiseCity.mp3" "sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3" "sound/ttt/Inno-Zeph-5-CominInHot.mp3" "sound/ttt/Inno-Zeph-6-RunToTheHills.mp3" "sound/ttt/Inno-Zeph-7-Shots.mp3" "sound/ttt/Inno-Zeph-8-BottomsUp.mp3" "sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3" "sound/ttt/Inno-Zeph-10-InvadersMustDie2.mp3" "sound/ttt/Inno-Zeph-11-Omen.mp3" "sound/ttt/Inno-Zeph-12-BloodSugar.mp3" "sound/ttt/Inno-Zeph-13-Lullaby1.mp3" "sound/ttt/Inno-Zeph-14-Lullaby2.mp3" "sound/ttt/Inno-Zeph-15-GroundAndPound1.mp3" "sound/ttt/Inno-Zeph-16-GroundAndPound2.mp3" "sound/ttt/Inno-Zeph-17-GroundAndPound3.mp3" "sound/ttt/Inno-Zeph-18-Iridescent.mp3" "sound/ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3" "sound/ttt/Inno-Zeph-3-ParadiseCity.mp3" "sound/ttt/Inno-Zeph-4-TakeItToTheLimit.mp3" "sound/ttt/Inno-Zeph-5-CominInHot.mp3" "sound/ttt/Inno-Zeph-6-RunToTheHills.mp3" "sound/ttt/Inno-Zeph-7-Shots.mp3" "sound/ttt/Inno-Zeph-8-BottomsUp.mp3" "sound/ttt/Inno-Zeph-9-InvadersMustDie1.mp3" "sound/ttt/Trait-Zeph-1-HighwayToHell.mp3" "sound/ttt/Trait-Zeph-10-Burn.mp3" "sound/ttt/Trait-Zeph-11-Monster.mp3" "sound/ttt/Trait-Zeph-12-DangerZone.mp3" "sound/ttt/Trait-Zeph-13-RaiseALittleHell.mp3" "sound/ttt/Trait-Zeph-14-CantTouchThis.mp3" "sound/ttt/Trait-Zeph-15-MidnightQueen.mp3" "sound/ttt/Trait-Zeph-16-BloodOnMyHands.mp3" "sound/ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3" "sound/ttt/Trait-Zeph-18-ChaChing.mp3" "sound/ttt/Trait-Zeph-2-CrazyTrain.mp3" "sound/ttt/Trait-Zeph-3-Glory.mp3" "sound/ttt/Trait-Zeph-4-Tendencies.mp3" "sound/ttt/Trait-Zeph-5-BleedItOut.mp3" "sound/ttt/Trait-Zeph-6-Battery.mp3" "sound/ttt/Trait-Zeph-7-RideTheLightning.mp3" "sound/ttt/Trait-Zeph-8-MasterOfPuppets.mp3" "sound/ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3" } for i = 0, #t, 1 do Resource.AddFile(songs[i]) end local function PlayMusic(wintype) local randomsound = songs[math.random(#songs)] local stringsong = string.Implode("", { "'surface.PlaySound(\"", randomsound, "\")'" }) BroadcastLua(stringsong) end hook.Add("TTTEndRound", "MyMusic", PlayMusic) [/lua] So I made this to choose between all of them sounds on round end. Yet it doesn't do anything. Doesn't play any sound at all. Anyone know why :C?
Is there something from the code you aren't showing? From what I can tell, you resource.AddFile all the mp3s, and then, created a table of all the songs [I](which didn't work because you didn't put a , after each mp3)[/I] then looped through it [I](using #t and t was nil)[/I] and tried to Resource.AddFile them again [I](and Resource isn't in gmod by default by the way)[/I] And, sound/ is the filepath you tried to play which didn't work because you don't need sound/ in the path. edit: I think this is what you want [lua] local songs = { "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Trait-Zeph-1-HighwayToHell.mp3", "ttt/Trait-Zeph-10-Burn.mp3", "ttt/Trait-Zeph-11-Monster.mp3", "ttt/Trait-Zeph-12-DangerZone.mp3", "ttt/Trait-Zeph-13-RaiseALittleHell.mp3", "ttt/Trait-Zeph-14-CantTouchThis.mp3", "ttt/Trait-Zeph-15-MidnightQueen.mp3", "ttt/Trait-Zeph-16-BloodOnMyHands.mp3", "ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3", "ttt/Trait-Zeph-18-ChaChing.mp3", "ttt/Trait-Zeph-2-CrazyTrain.mp3", "ttt/Trait-Zeph-3-Glory.mp3", "ttt/Trait-Zeph-4-Tendencies.mp3", "ttt/Trait-Zeph-5-BleedItOut.mp3", "ttt/Trait-Zeph-6-Battery.mp3", "ttt/Trait-Zeph-7-RideTheLightning.mp3", "ttt/Trait-Zeph-8-MasterOfPuppets.mp3", "ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3" } for k,v in pairs(songs) do resource.AddFile("sound/"..v) end local function PlayMusic(wintype) local randomsound = songs[math.random(#songs)] local stringsong = "surface.PlaySound('"..randomsound.."')" BroadcastLua(stringsong) end hook.Add("TTTEndRound", "MyMusic", PlayMusic) [/lua]
[QUOTE=ArmageddonScr;35220018]Is there something from the code you aren't showing? From what I can tell, you resource.AddFile all the mp3s, and then, created a table of all the songs [I](which didn't work because you didn't put a , after each mp3)[/I] then looped through it [I](using #t and t was nil)[/I] and tried to Resource.AddFile them again [I](and Resource isn't in gmod by default by the way)[/I] And, sound/ is the filepath you tried to play which didn't work because you don't need sound/ in the path. edit: I think this is what you want [lua] local songs = { "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Inno-Zeph-10-InvadersMustDie2.mp3", "ttt/Inno-Zeph-11-Omen.mp3", "ttt/Inno-Zeph-12-BloodSugar.mp3", "ttt/Inno-Zeph-13-Lullaby1.mp3", "ttt/Inno-Zeph-14-Lullaby2.mp3", "ttt/Inno-Zeph-15-GroundAndPound1.mp3", "ttt/Inno-Zeph-16-GroundAndPound2.mp3", "ttt/Inno-Zeph-17-GroundAndPound3.mp3", "ttt/Inno-Zeph-18-Iridescent.mp3", "ttt/Inno-Zeph-2-WelcomeToTheJungle.mp3", "ttt/Inno-Zeph-3-ParadiseCity.mp3", "ttt/Inno-Zeph-4-TakeItToTheLimit.mp3", "ttt/Inno-Zeph-5-CominInHot.mp3", "ttt/Inno-Zeph-6-RunToTheHills.mp3", "ttt/Inno-Zeph-7-Shots.mp3", "ttt/Inno-Zeph-8-BottomsUp.mp3", "ttt/Inno-Zeph-9-InvadersMustDie1.mp3", "ttt/Trait-Zeph-1-HighwayToHell.mp3", "ttt/Trait-Zeph-10-Burn.mp3", "ttt/Trait-Zeph-11-Monster.mp3", "ttt/Trait-Zeph-12-DangerZone.mp3", "ttt/Trait-Zeph-13-RaiseALittleHell.mp3", "ttt/Trait-Zeph-14-CantTouchThis.mp3", "ttt/Trait-Zeph-15-MidnightQueen.mp3", "ttt/Trait-Zeph-16-BloodOnMyHands.mp3", "ttt/Trait-Zeph-17-ThroughTheFireAndTheFlames.mp3", "ttt/Trait-Zeph-18-ChaChing.mp3", "ttt/Trait-Zeph-2-CrazyTrain.mp3", "ttt/Trait-Zeph-3-Glory.mp3", "ttt/Trait-Zeph-4-Tendencies.mp3", "ttt/Trait-Zeph-5-BleedItOut.mp3", "ttt/Trait-Zeph-6-Battery.mp3", "ttt/Trait-Zeph-7-RideTheLightning.mp3", "ttt/Trait-Zeph-8-MasterOfPuppets.mp3", "ttt/Trait-Zeph-9-TakeMeToTheHospital.mp3" } for k,v in pairs(songs) do resource.AddFile("sound/"..v) end local function PlayMusic(wintype) local randomsound = songs[math.random(#songs)] local stringsong = "surface.PlaySound('"..randomsound.."')" BroadcastLua(stringsong) end hook.Add("TTTEndRound", "MyMusic", PlayMusic) [/lua][/QUOTE] That worked! Thanks
Is there a way to "Undo" MakePopup()?
[b][url=http://luasearch.netau.net/?list=Panel+methodmatch&func=Panel.Remove]Panel:Remove [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b]
No other way to regain mouse and keyboard control without removing it...?
You could try using [b][url=http://luasearch.netau.net/?list=gui&func=gui.EnableScreenClicker]gui.EnableScreenClicker [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b] set to false.
[QUOTE=Nerdeboy;35222945]You could try using [b][url=http://luasearch.netau.net/?list=gui&func=gui.EnableScreenClicker]gui.EnableScreenClicker [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b] set to false.[/QUOTE] I tried that but it didn't do anything.
Do you want to close the panel or just return control to the player?
I just want to be able to be able to give control to the player, and then not
I generally use gui.EnableScreenClicker instead of MakePopup with things like scoreboards and admin mods when I want the player to be able to move while the popup is made [editline]20th March 2012[/editline] Is it possible to use any text drawing functions in the menu state like you could with HUDPaint
Okay this is only bits of the code, so if you see what I'm doing wrong or need more info, let me know. First of all, the timers don't seem to be working. Second of all, the tazedPlayer:ConCommand("pp_motionblur 1") also blurs me. Nothing else happens to me like the hud print, only the motion blur. [lua] eyeTrace = self.Owner:GetEyeTrace() if !eyeTrace.Entity:IsPlayer() then return end [/lua] ------------------------------------------------------------------------------------------------------------- [lua] if eyeTrace.Entity:IsPlayer() then self.Weapon:EmitSound("Weapon_StunStick.Activate") self:tasePlayer(eyeTrace.Entity) self.BaseClass.ShootEffects(self) SetGlobalInt("reloadTimer",CurTime()+10) SetGlobalInt("tazedTimer",CurTime()+5) tazedPlayer = eyeTrace.Entity oldModel = eyeTrace.Entity:GetMaterial() end [/lua] ------------------------------------------------------------------------------------------------------------- [lua] function SWEP:tasePlayer(tazedPlayer) if ( CurTime() < GetGlobalInt("tazedTimer") ) then tazedPlayer:SetMoveType(MOVETYPE_NONE) tazedPlayer:ConCommand("pp_motionblur 1") tazedPlayer:PrintMessage(HUD_PRINTCENTER, "You got tased bro.") tazedPlayer:SetMaterial( "models/alyx/emptool_glow" ) end if ( CurTime() > GetGlobalInt("tazedTimer") ) then tazedPlayer:SetMoveType(MOVETYPE_WALK) tazedPlayer:ConCommand("pp_motionblur 0") tazedPlayer:SetMaterial( oldModel ) end end [/lua]
Shouldn't it return nil if I try to access "_G.global" if I run this? [lua] global={"secrets"} setmetatable(_G,{ __index=function(tbl,key) if key=="global" then print "This is private!" return nil end return rawget(_G,key) end }) [/lua]
I am trying to remove the chat commands from Evolve, so you cannot see or use the chat commands in the chat box. This would mean you could only access the commands from the menu. Anyone know a way?
Hey guys, i downloaded a vehicle pack for darkrp ([url]http://www.garrysmod.org/downloads/?a=view&id=110381[/url]) and the main problem i am running into is that i set the vehicles so certain classes could spawn certain vehicles, but when they change class, the vehicle stays. Is there a way to make it so when a player changes jobs his vehicle disappears? A smaller and less important issue i am running into is that some of the vehicle models wont download to my clients, anyone have any idea why? Only a few of them don't. Any help is appreciated! Thanks in advance!
[QUOTE=marvincmarvin;35225413]Shouldn't it return nil if I try to access "_G.global" if I run this? [lua] global={"secrets"} setmetatable(_G,{ __index=function(tbl,key) if key=="global" then print "This is private!" return nil end return rawget(_G,key) end }) [/lua][/QUOTE] __index is only called if the variable being accessed is nil.
[QUOTE=RCRad;35227009]Hey guys, i downloaded a vehicle pack for darkrp ([url]http://www.garrysmod.org/downloads/?a=view&id=110381[/url]) and the main problem i am running into is that i set the vehicles so certain classes could spawn certain vehicles, but when they change class, the vehicle stays. Is there a way to make it so when a player changes jobs his vehicle disappears? A smaller and less important issue i am running into is that some of the vehicle models wont download to my clients, anyone have any idea why? Only a few of them don't. Any help is appreciated! Thanks in advance![/QUOTE] Which vehicles? Also I'd set it to check when they die if they're still the required class for the vehicle (if you have it set to kill them when they change jobs).
[QUOTE=ralle105;35228693]__index is only called if the variable being accessed is nil.[/QUOTE] So making "global" a local table should do the trick?
Yeah.
I have an entity that uses a model (a mining drill) with three animations: there's the startup animation where the drill fires up and lowers into the ground, an active drilling animation which is looped, and a shutdown animation where the drill slows and is retracted. What I need to do is play the startup sequence, and then transition into the looped drilling animation. What is the best way to trigger the second animation as soon as the first one is complete?
Not sure, but if you can get the duration of the animation, set a variable to CurTime()+duration and on think, if CurTime()>variable then play animation ?
[QUOTE=NnyAskC;35231876]Which vehicles? Also I'd set it to check when they die if they're still the required class for the vehicle (if you have it set to kill them when they change jobs).[/QUOTE] All the ones in the pack i linked. Mainly what im looking for is a lua command or console command that clears all of a clients vehicles.
Sorry, you need to Log In to post a reply to this thread.