delta1337 Posted October 21, 2018 Share Posted October 21, 2018 Hello, so last time ive made a script for multiple flares for every Helicopter and Plane, but the problem is they dont work, if your firing out flares they are just nothing doing and the HSrocket will still hit me without a single problem, can somebody help me with making them work? - Server side local timer= { } local timer_object= {} local move_object= {} addEventHandler('onPlayerJoin',root,function() bindKey(source,'b','down',function(gracz) if getPedOccupiedVehicle(gracz) and (getVehicleType(getPedOccupiedVehicle(gracz))=='Plane' or getVehicleType(getPedOccupiedVehicle(gracz))=='Helicopter') then if isTimer(timer[gracz]) then return end timer[gracz] = setTimer(function() end,3000,1) local x,y,z = getElementPosition(gracz); local xr,yr,zr = getElementRotation(gracz); local offsetRot = math.rad(zr+90); local vx = x+1*math.cos(offsetRot); local vy = y+1*math.sin(offsetRot); local vrot = zr+90; triggerClientEvent(root,'Zrzuc_RoadFire',root,vx, vy,x,y,z) end end) end) for _,v in pairs(getElementsByType('player')) do bindKey(v,'b','down',function(gracz) if getPedOccupiedVehicle(gracz) and (getVehicleType(getPedOccupiedVehicle(gracz))=='Plane' or getVehicleType(getPedOccupiedVehicle(gracz))=='Helicopter') then if isTimer(timer[gracz]) then return end timer[gracz] = setTimer(function() end,3000,1) local x,y,z = getElementPosition(gracz); local xr,yr,zr = getElementRotation(gracz); local offsetRot = math.rad(zr+90); local vx = x+1*math.cos(offsetRot); local vy = y+1*math.sin(offsetRot); local vrot = zr+90; triggerClientEvent(root,'Zrzuc_RoadFire',root,vx, vy,x,y,z) end end) end addEvent('Zrzuc_Delte',true) addEventHandler('Zrzuc_Delte',root,function(rx,ry,x,y,z,rz) for i=1,3 do local object = createObject(354,rx,ry-i,rz-3) setElementAlpha(object,0) move_object[object] = setTimer(function(object,rx,ry,x,y,z,rz,i) local los = math.random(0,1) if los==1 then moveObject(object,9000,rx+math.random(10,40),ry-i-math.random(1,6),z) else moveObject(object,9000,rx-math.random(10,40),ry-i-math.random(1,6),z) end end,50,1,object,rx,ry,x,y,z,rz,i) timer_object[object] = setTimer(function(object) destroyElement(object) end,2000*2,1,object) end end) Client side - -- 354 addEvent('Zrzuc_RoadFire',true) addEventHandler('Zrzuc_RoadFire',root,function(rx,ry,x,y,z) local ground = getGroundPosition(x,y,z) triggerServerEvent('Zrzuc_Delte',root,rx,ry,x,y,ground,z) end) Link to comment
Z4Zy Posted October 23, 2018 Share Posted October 23, 2018 i think you had to create another lines of code for change target of the HSrockets. I think so ! Link to comment
delta1337 Posted October 25, 2018 Author Share Posted October 25, 2018 Thank you for the reply. Do you have any idea which code i need to use to make HSRPG hit the target? Cause ive searched it and i could not find it. Link to comment
mucuk6547 Posted October 26, 2018 Share Posted October 26, 2018 17 hours ago, delta1337 said: Thank you for the reply. Do you have any idea which code i need to use to make HSRPG hit the target? Cause ive searched it and i could not find it. Scripts link pls. Link to comment
MIKI785 Posted October 26, 2018 Share Posted October 26, 2018 If you want to control whether the rockets actually seek the target or not you have to implement this yourself using createProjectile. Link to comment
mucuk6547 Posted October 26, 2018 Share Posted October 26, 2018 39 minutes ago, MIKI785 said: If you want to control whether the rockets actually seek the target or not you have to implement this yourself using createProjectile. How to add a gun to a car? 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