Jump to content

HELP*


#STZ

Recommended Posts

Hello Guys

local vehicle = getPedOccupiedVehicle(localPlayer) 
local x, y, z = getElementPosition(vehicle)


function shootProjectile() 
    if (vehicle) and getElementDimension ( source, 1 ) then 
        createProjectile(vehicle, 19, x, y, z) 
		outputChatBox("تم اطلاق الصاروخ", source, 255, 0, 0)
    end 
end 
  
bindKey("vehicle_fire", "down", shootProjectile) 

at first it was working done

 

but when i add 

getElementDimension ( source, 1 )

it doesn,t shot and doesn,t working

Link to comment

Test this : 

Client Side 

function shoot ( )
local myVehicle = getPedOccupiedVehicle ( localPlayer )
if ( myVehicle and getVehicleController ( myVehicle ) == localPlayer ) then 
local pos = { getElementPosition ( myVehicle ) };
createProjectile ( vehicle , pos[1] , pos[2] , pos[3] )
outputChatBox('تم اطلاق الصاروخ',255,0,0,true)
end
end
bindKey ( 'vehicle_fire' , 'down' , shoot )

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...