#STZ Posted January 15, 2017 Share Posted January 15, 2017 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
^iiEcoo'x_) Posted January 15, 2017 Share Posted January 15, 2017 (edited) if ( getElementDimension ( localPlayer ) == 1 then Edited January 15, 2017 by #_iMr,[E]coo 1 Link to comment
Simple0x47 Posted January 15, 2017 Share Posted January 15, 2017 11 minutes ago, #_iMr,[E]coo said: if ( getElementDimension ( localPlayer ) == 1 then Expected: if ( getElementDimension ( localPlayer ) == 1 ) then 1 Link to comment
' A F . Posted January 20, 2017 Share Posted January 20, 2017 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
Abdul KariM Posted January 20, 2017 Share Posted January 20, 2017 @Default line 5 vehicle = nil rest to this createProjectile ( myVehicle , pos[1] , pos[2] , pos[3] ) Link to comment
' A F . Posted January 20, 2017 Share Posted January 20, 2017 oh , thanks Copied code 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