☠ RaZeR ☠ Posted April 11, 2015 Share Posted April 11, 2015 hi i have make tank vs tank but the tank id : 432 not effect on the other tank the damage after shooting 1000% no effect of rhino weapon :: help me Link to comment
Mr.unpredictable. Posted April 11, 2015 Share Posted April 11, 2015 make it like when there is an explosion setElementhealth Link to comment
Banex Posted April 11, 2015 Share Posted April 11, 2015 try this function clientExplosion(x,y,z,type) if type == 10 then local vehicle = getPedOccupiedVehicle(localPlayer) if isElement(vehicle) and getElementModel(vehicle) == 432 then if getDistanceBetweenPoints3D( x,y,z , getElementPosition(vehicle)) < 8 then setElementHealth(vehicle,getElementHealth(vehicle) - 200) end end end end addEventHandler("onClientExplosion",root,clientExplosion) Link to comment
☠ RaZeR ☠ Posted April 11, 2015 Author Share Posted April 11, 2015 debugscript error : '=' expected near ' line 2 # Link to comment
#RooTs Posted April 11, 2015 Share Posted April 11, 2015 try use element or "theVeicle" function clientExplosion(x,y,z,element, theVeicle) if element == 10 then Link to comment
Banex Posted April 11, 2015 Share Posted April 11, 2015 same Problem I don't understand, I tested and it worked well for me @RooTs, do you even know what are you trying to do? this makes totally no sense. I would like to suggest you to help yourself first before trying to help other peoples. Link to comment
RenanPG Posted April 12, 2015 Share Posted April 12, 2015 server-side addEventHandler("onVehicleDamage", getRootElement(), function() if(getElementModel(source) == 432) then setElementHealth(source, getElementHealth(source) - 100) end end) Link to comment
Banex Posted April 12, 2015 Share Posted April 12, 2015 (edited) server-side addEventHandler("onVehicleDamage", getRootElement(), function() if(getElementModel(source) == 432) then setElementHealth(source, getElementHealth(source) - 100) end end) this will not work, because the rhino takes no damage, except to flames Edited April 12, 2015 by Guest Link to comment
RenanPG Posted April 12, 2015 Share Posted April 12, 2015 server-side addEventHandler("onVehicleDamage", getRootElement(), function() if(getElementModel(source) == 432) then setElementHealth(source, getElementHealth(source) - 100) end end) this will not work, why the rhino takes no damage, except to flames Where did you read that? Link to comment
Banex Posted April 12, 2015 Share Posted April 12, 2015 i had this same problem with the rhino before, soon after i did some tests and came to this conclusion Link to comment
ViPeR- Posted April 12, 2015 Share Posted April 12, 2015 The code of Hornet works just perfectly , i have tested it before a few minutes. Link to comment
RenanPG Posted April 12, 2015 Share Posted April 12, 2015 i had this same problem with the rhino before, soon after i did some tests and came to this conclusion It's your conclusion, not proved. Link to comment
Banex Posted April 12, 2015 Share Posted April 12, 2015 i just have tried it and not worked for any weapon or explosive damage. @Hornet, you can test on its own, if work with you, it means that there is some bug in my GTA. I do not believe in that, because @theFOX_script also is having the same problem Link to comment
ViPeR- Posted April 12, 2015 Share Posted April 12, 2015 function DamageBMX(attacker, weapon, loss, x, y, z, tyre) if (getElementModel(source) == 432) then cancelEvent() end if (getElementModel(source) == 432) then local health = getElementHealth(source) local losehealth = setElementHealth(source,health-90) if(health == 10) then x,y,z = getElementPosition(source) createExplosion(x,y,z,4,true,_,true) end end end addEventHandler("onClientVehicleDamage", root, DamageBMX) The code of Hornet works good , but you can try anyway the code which i've created for my own server , it works without doubts. Link to comment
RenanPG Posted April 12, 2015 Share Posted April 12, 2015 i just have tried it and not worked for any weapon or explosive damage. Hornet, you can test on its own, if work with you, it means that there is some bug in my GTA I tested now, with three shoots the vehicle got exploded. Link to comment
Banex Posted April 12, 2015 Share Posted April 12, 2015 the same happened to me, but the rhino exploded by flames that the rocket left in place, and not by the explosion Link to comment
RenanPG Posted April 12, 2015 Share Posted April 12, 2015 the same happened to me, but the rhino exploded by flames that the rocket left in place, and not by the explosion Your creativity to invent a lame excuse is amazing, keep it up dude. Link to comment
MaRcell Posted April 12, 2015 Share Posted April 12, 2015 i just test, and me too did not work Link to comment
Banex Posted April 12, 2015 Share Posted April 12, 2015 Why do you think I would have reason to lie? Link to comment
ViPeR- Posted April 12, 2015 Share Posted April 12, 2015 i just test, and me too did not work Well , then you did something wrong , why don't you just upload a video? Link to comment
RenanPG Posted April 12, 2015 Share Posted April 12, 2015 Why do you think I would have reason to lie? I didn't say you are lying, i'm supposing you are inventing it, but in my server and viper's server worked. Link to comment
Mr.unpredictable. Posted April 12, 2015 Share Posted April 12, 2015 The explosion id is 51 make it like If weapon is 51 then setelementheath easiest way to do that. sorry i'm using forum from my cell phone, can't write the code write now. Link to comment
Mr.unpredictable. Posted April 12, 2015 Share Posted April 12, 2015 server-side addEventHandler("onVehicleDamage", getRootElement(), function() if(getElementModel(source) == 432) then setElementHealth(source, getElementHealth(source) - 100) end end) are you kidding?? This will also make raino to get damage from other weapons.Edit: anyway, Here is the code which will make tank to get damage from Explosion. function tankdamage(attacker, weapon, loss, x, y, z, tyre) if (weapon == 51 and getElementModel(source) == 432 then ----------51 is Explosion id setElementHealth(source,getElementHealth(source) - 500) ------- this will make tank lose 50% heath with Explosion. cancelEvent() end end addEventHandler("onClientVehicleDamage", root, tankdamage) 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