Namorek Posted December 26, 2010 Share Posted December 26, 2010 Hi again. How script Fire Extinguisher and Fire Truck on Water it Vehicle by Broken to repair. Link to comment
dzek (varez) Posted December 26, 2010 Share Posted December 26, 2010 If you don't know English, please use Google Translate, it's giving better results, until you can build proper Polish sentences.. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 Maybe look you Picture Fire Extinguisher to Vehicle is Broken to Repair max 50% HP Vehicle you know? Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 now i get it: fix vehicle with fire extinguisher. here (client-side): function vehicleFireFix(weapon, _, _, _, _, _, element) if weapon == 42 and element and getElementType(element) == "vehicle" then local health = getElementHealth(element) if health < 500 then -- dont want to "fix" healthy cars --fixVehicle(element) -- uncomment to fix the damage model also setElementHealth(element, health + 10) end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), vehicleFireFix) EDIT: added a health check EDIT2: "gradual" healing, you can change "healing" speed by editing "health + 10" Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 now i get it: fix vehicle with fire extinguisher. here (client-side): function vehicleFireFix(weapon, _, _, _, _, _, element) if weapon == 42 and element and getElementType(element) == "vehicle" then if getElementHealth(element) < 500 then -- dont want to "fix" healthy cars --fixVehicle(element) -- uncomment to fix the damage model also setElementHealth(element, 500) end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), vehicleFireFix) EDIT: added a health check Very thanks! and Please Vehicle has broken and Fire no Bomb long this fire help Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 Very thanks! and Please Vehicle has broken and Fire no Bomb long this fire help sorry, now i dont get it again. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 ok cool, Deleted Topic! Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 why not leave it be? other people may have the same question. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 ok not deleted Link to comment
dzek (varez) Posted December 26, 2010 Share Posted December 26, 2010 setting vehicle health client side wont make it synced i think? not sure about it but.. Link to comment
12p Posted December 26, 2010 Share Posted December 26, 2010 Maybe he means prevent the explosion (while fire is burning the vehicle) using the fire extinguisher. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 You look Car Fire next Bum.. i want Fire next not bum is every fire Link to comment
CowTurbo Posted December 26, 2010 Share Posted December 26, 2010 he wnat that car will be on fire, but wont blow Link to comment
dzek (varez) Posted December 26, 2010 Share Posted December 26, 2010 maybe cancelling explosion event will work? idk. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 always fire vehicle, (Translator)that the extinguisher will put out the fire Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 setting vehicle health client side wont make it synced i think? not sure about it but.. i think it will be synced, as long as the vehicle element is synced. well that's my assumption anyway. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 give the code or not? Link to comment
LuzC Posted December 26, 2010 Share Posted December 26, 2010 If you guys still don't understand him : He wants a code to not let vehicles get on fire when it is low HP and make the the people fire extinguish their own vehicles. Link to comment
12p Posted December 26, 2010 Share Posted December 26, 2010 WE AREN'T FULLFILLING REQUESTS FOR SCRIPTS! You said it like "give me the code or I kill you", like if we are employees of yours you should (at least) say "please"! Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 with the script above it works fine, i've tested, you can extinguish the fire and it stops > no explosion. that is of course if you'll make it in time. or you want the vehicle not exploding at all when burning? i dont think that can be done easily, cancelling the onVehicleExplode event doesnt help here. Link to comment
DiSaMe Posted December 26, 2010 Share Posted December 26, 2010 If the vehicle is about to blow up and you use setVehicleDamageProof on it, the it will keep burning, but won't explode. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 function notifyAboutExplosion() outputChatBox(getVehicleName(source) .. " not bom :D") end addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion) is good? Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 nop, you'll need to find some event (i suggest onVehicleDamage when vehicle health below 250, if i remember correctly when fire starts) and set it damageproof, as Doomed_Space_Marine suggested. and then when you put out the fire - set it back to normal. though i dont see a point to make vehicles burning this way, they'll be indestructible. Link to comment
Namorek Posted December 26, 2010 Author Share Posted December 26, 2010 it hard! bun = getElementHealth health < 200 function nobum setVehicleDamageProof(bun,true) addEventHandler( "onPlayerSpawn", rootElement, nobun ) is good? Link to comment
dzek (varez) Posted December 26, 2010 Share Posted December 26, 2010 This guy since last 3 months learned NOTHING. Because you all are giving him complete codes, instead of trying to teach him something Like a slaves. Ehh. Namorek - maybe post in Polish section? You will probably find more ppl being able to help you and teach you something, so you won't have to post new topic in every problem you want to solve? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now