RekZ Posted January 8, 2017 Share Posted January 8, 2017 if there is a passengers in the swat , shot 2 rockets , how i can fixed ? function Dhooter( ) if isPedInVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) and getVehicleOccupant ( veh , 0 ) then if ( getElementModel ( veh ) == 601 ) then local X, Y, Z = getElementPosition(veh) createProjectile(veh, 19 , turX, turY, turZ, 0, nil, 0, 0, 0) --createExplosion(turX, turY, turZ , 8, false, 0.5, false) end end end end Link to comment
Dimos7 Posted January 8, 2017 Share Posted January 8, 2017 (edited) function Dhooter( ) if isPedInVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) and getPedOccupiedVehicleSeat (localPlayer) == 0 then if ( getElementModel ( veh ) == 601 ) then local X, Y, Z = getElementPosition(veh) createProjectile(veh, 19 , turX, turY, turZ, 0, nil, 0, 0, 0) --createExplosion(turX, turY, turZ , 8, false, 0.5, false) end end end end Edited January 8, 2017 by Dimos7 Link to comment
RekZ Posted January 8, 2017 Author Share Posted January 8, 2017 I have the same problem , shoot 2 rockets whit passenger 12 minutes ago, Dimos7 said: function Dhooter( ) if isPedInVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) and getPedOccupiedVehicleSeat (localPlayer) == 0 then if ( getElementModel ( veh ) == 601 ) then local X, Y, Z = getElementPosition(veh) createProjectile(veh, 19 , turX, turY, turZ, 0, nil, 0, 0, 0) --createExplosion(turX, turY, turZ , 8, false, 0.5, false) end end end end Link to comment
Dimos7 Posted January 8, 2017 Share Posted January 8, 2017 function Dhooter( ) if isPedInVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) if getPedOccupiedVehicleSeat (localPlayer) == 0 then if ( getElementModel ( veh ) == 601 ) then local X, Y, Z = getElementPosition(veh) createProjectile(veh, 19 , turX, turY, turZ, 0, nil, 0, 0, 0) --createExplosion(turX, turY, turZ , 8, false, 0.5, false) end end end end Link to comment
RekZ Posted January 8, 2017 Author Share Posted January 8, 2017 (edited) The same problem , no error Edited January 8, 2017 by RekZ Link to comment
Dimos7 Posted January 8, 2017 Share Posted January 8, 2017 are you sure there are any other think try to do maybe in that script you have something let it happend Link to comment
RekZ Posted January 8, 2017 Author Share Posted January 8, 2017 create 2 rockets , one whit the position of mine and other whit the position of the passenger y test whit a chatbox and the passenger recibe the message too Link to comment
Dimos7 Posted January 8, 2017 Share Posted January 8, 2017 maybe there is the problem Link to comment
RekZ Posted January 8, 2017 Author Share Posted January 8, 2017 but this is for only get the driver no ? if getPedOccupiedVehicleSeat (localPlayer) == 0 then Link to comment
LoPollo Posted January 10, 2017 Share Posted January 10, 2017 If the problem still persists, and i understand right, is it possible that this is due a MTA bug? Wiki reports some issues Issue ID Description #8132 Projectile target only allows player element (and a projectile?) #5072 createProjectile creates one projectile for every person in the vehicle If it's not due a bug, what happens if you temporary set as creator the localPlayer? Link to comment
RekZ Posted January 11, 2017 Author Share Posted January 11, 2017 The ID 5072 is right , i test in a car whit 4 Passengers and create 4 projectiles , and the same whit 3... 3 projectiles.. , my head blow think in this function Link to comment
^iiEcoo'x_) Posted January 11, 2017 Share Posted January 11, 2017 (edited) To @iPrestege bindKey("w","down", function ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ); if ( vehicle ) then createProjectile(vehicle,19); outputChatBox("Text "255,255,0,true); else outputChatBox("text",255,0,0,true); end end ); addEventHandler("onClientResourceStart",resourceRoot, function ( ) setWorldSpecialPropertyEnabled ( "aircars",true ); end ); If you want to SWAT team Server ! addEvent('check', true) addEventHandler('check', root, function ( plr ) if getElementData ( plr, "gang" ) == "SWAT" then triggerClientEvent ("shoot", source) end end ) Client ! addEvent('shoot', true) addEventHandler('shoot', root, function () local vehicle = getPedOccupiedVehicle(localPlayer) local rX,rY,rZ = getElementRotation(vehicle) local x, y, z = getElementPosition(vehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) if ( vehicle ) then createProjectile(vehicle, 19, x, y, z, 1.0, nil) end end) function shootProjectile() triggerServerEvent("check", localPlayer, localPlayer) end bindKey("vehicle_fire", "down", shootProjectile) bindKey("lctrl", "down", shootProjectile) bindKey("rctrl", "down", shootProjectile) Edited January 11, 2017 by #_iMr,[E]coo 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