• Giving the vehicle HP and manipulating it.
    23 replies, posted
  • Avatar of RedNinja
  • I am trying to set to [URL="http://www.garrysmod.org/downloads/?a=view&id=70195"]this[/URL] vehicle HP, maybe 200-300, i dont know, it doesnt matter to me atm, the point is i want to do that after the HP is 0, or below 0, it ignites, after 10 seconds explodes and after 30 seconds it just vanishes. I could do that myself if it was an entity, but it is not. The only lua file is [CODE]local Category = "Half-Life 2" local function HandleRollercoasterAnimation( vehicle, player ) return player:SelectWeightedSequence( ACT_GMOD_SIT_ROLLERCOASTER ) end local V = { // Required information Name = "BF2 Buggy", Class = "prop_vehicle_jeep_old", Category = Category, // Optional information Author = "MaKc,Erghize", Information = "Buggy from BF2", Model = "models/bf2bb.mdl", KeyValues = { vehiclescript = "scripts/vehicles/jeep_test.txt" } } list.Set( "Vehicles", "BF2 Buggy", V )[/CODE] I need it urgently, thanks for whoever helps/tries to.
  • Sorry guys, he already 'has it'. ' [IMG]http://manolisvrondakis.com/AlreadyHaveIt.png[/IMG] And well, he was just trying to 'see if I have knowledge in coding' [IMG]http://manolisvrondakis.com/KnowledgeInCoding.png[/IMG] So don't help him.
  • Avatar of RedNinja
  • [QUOTE=Coffeee;36741566]Sorry guys, he already 'has it'. ' [IMG]http://manolisvrondakis.com/AlreadyHaveIt.png[/IMG] And well, he was just trying to 'see if I have knowledge in coding' [IMG]http://manolisvrondakis.com/KnowledgeInCoding.png[/IMG] So don't help him.[/QUOTE] This guy is pissed because i didnt hire him as a coder.
  • Avatar of Failure
  • Well that's interesting, maybe post the whole conversation if you don't mind.
  • [QUOTE=Failure;36741789]Well that's interesting, maybe post the whole conversation if you don't mind.[/QUOTE] [img]http://manolisvrondakis.com/DrinkResponsibly.png[/img]
  • Avatar of brandonj4
  • [QUOTE=Failure;36741917]Oh, then it's good that I didn't waste my time working on this script.[/QUOTE] Exactly, this kid should get banned for exploiting the good nature of members on Facepunch.
  • Avatar of RedNinja
  • [QUOTE=brandonj4;36742312]Exactly, this kid should get banned for exploiting the good nature of members on Facepunch.[/QUOTE] Good nature.... hahahaha man you've made my day
  • Avatar of dylanb5123
  • [QUOTE=RedNinja;36742625]Good nature.... hahahaha man you've made my day[/QUOTE] hahahaha man stop being a dick
  • Avatar of nick_9_8
  • [QUOTE=RedNinja;36742625]Good nature.... hahahaha man you've made my day[/QUOTE] I took the time to think of an effective situation for this. Show us the completed code which works... you have it, after all. And don't say you want it to be private, because the coder was most likely going to chuck it in a code box in this thread.
  • Avatar of Sillirion
  • i would simply create a box based on the car sized who can only be damaged by weapons, and physics... And when it dies remove it with the car with an explosion.
  • Avatar of Divran
  • So clearly students shouldn't answer the teacher's questions at school, because the teachers already know the answers. Obviously. EDIT: This is a bit of a roundabout way of finding coders to hire, though.
  • Avatar of Failure
  • I think it will be best to ask Sakarias, he made SCars after all, they're damageable and what not.
  • Avatar of noobcake
  • the thing with scars is that they're entirely separate entities though not based on source vehicles at all
  • Avatar of KatNotDinner
  • And SCars are made out of a few entites and constraints so they can be laggy if there are many of them plus they get buggy under some conditions.
  • Avatar of Failure
  • [QUOTE=noobcake;36762375]the thing with scars is that they're entirely separate entities though not based on source vehicles at all[/QUOTE] Good point there mate, I thought they were half lua and half source. My bad. In my opinion it can be done like someone said earlier, create a box around the vehicle that will take the damage and when the damage hits the critical limit, then remove the vehicle, spawn some eye candy explosion effects and remove the box.
  • Avatar of SeveredSkull
  • I must say you people are brilliant: [code] function GM:EntityTakeDamage( ent, inflictor, attacker, amount ) // If it is a car if ( ent:GetClass() == "prop_vehicle") then ent.health = (ent.health or 100) - amount if ent.health <= 0 then ent:Remove() end end end [/code] Don't need it in game mode format? Just add a hook. You people are over thinking this damn thing. [editline]14th July 2012[/editline] And you can do your own Timer shit on your own. You have the code already there after all.
  • Avatar of SeveredSkull
  • Dont know what the fuck you are smoking... works fine for me. [editline]14th July 2012[/editline] Better yet, [B]explain [/B]why its "shitty" code. I gotta hear this...
  • Avatar of Sillirion
  • raaah i was thinking it would be for autorun...dunno why.. where it would not work because it would not recognize "gm" btw if you would make a hook, ent in line 2 would cause a problem too...just tryied it to verify i didn't tell shit... Btw i'm sorry man, i was rude, in a bad mood sorry...
  • Avatar of SeveredSkull
  • Umm... no it wouldnt. if you make it a hook, parameters stay the same... I'll let you quit while you are ahead...
  • Avatar of Sillirion
  • you mean like that? [lua]function EntityTakeDamage( ent, inflictor, attacker, amount ) // If it is a car if ( ent:GetClass() == "prop_vehicle") then ent.health = (ent.health or 100) - amount if ent.health <= 0 then ent:Remove() end end end hook.Add("Think", "EntityTakeDamage", EntityTakeDamage) [/lua]
  • Avatar of freemmaann
  • [QUOTE=noobcake;36762375]the thing with scars is that they're entirely separate entities though not based on source vehicles at all[/QUOTE] [video=youtube;PGRrpx3Nan8]http://www.youtube.com/watch?v=PGRrpx3Nan8[/video] *Caught* Was gonna give him a stripped down version of that here, till I started reading the posts bellow.