SkiZo Posted July 8, 2017 Posted July 8, 2017 Hello , i don't know where is the problem .. some help ? i'm trying to make this work only in Dimension 1 . this's Client Side function shootProjectile(localPlayer) if ( getElementDimension ( localPlayer ) == 1 ) then local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end --bindKey("vehicle_fire", "down", shootProjectile) bindKey("2", "down", shootProjectile) did not work .
#BrosS Posted July 8, 2017 Posted July 8, 2017 You don't have to define localPlayer , the bind 2 is not numeric if you think it is and use debugscript
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 25 minutes ago, #BrosS said: You don't have to define localPlayer , the bind 2 is not numeric if you think it is and use debugscript i know is not numeric .. debugscript ..
#BrosS Posted July 8, 2017 Posted July 8, 2017 8 minutes ago, Legend<3 said: i know is not numeric .. debugscript .. don't define localPlayer
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 (edited) 3 minutes ago, #BrosS said: don't define localPlayer function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) if ( getElementDimension ( vehicle ) == 1 ) then if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("vehicle_fire", "down", shootProjectile) No Errors. No Work. I'm thinking about making server side .. ServerSide function shootProjectileserver() if ( getElementDimension ( source ) == 1 and seat == 0 ) then triggerClientEvent (source, "shootProjectile", source) end end bindKey("vehicle_fire", "down", shootProjectileserver) Client Side addEvent ("shootProjectile", true) addEventHandler ("shootProjectile", getRootElement(), function() local vehicle = getPedOccupiedVehicle(localPlayer) -- if ( getElementDimension ( vehicle ) == 1 ) then if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end -- else cancelEvent() --end end) but Fail To Edited July 8, 2017 by Legend<3
#BrosS Posted July 8, 2017 Posted July 8, 2017 11 minutes ago, Legend<3 said: function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) if ( getElementDimension ( vehicle ) == 1 ) then if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("vehicle_fire", "down", shootProjectile) No Errors. No Work. wut ? i've tested it and it worked
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 You test it in wich dimension .. idk why it did not work ..
kieran Posted July 8, 2017 Posted July 8, 2017 (edited) 32 minutes ago, #BrosS said: don't define localPlayer 13 minutes ago, Legend<3 said: You test it in wich dimension .. idk why it did not work .. function shootProjectile() vehicle = getPedOccupiedVehicle(Player) if ( getElementDimension ( vehicle ) == 1 ) then if(vehicle)then x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("vehicle_fire", "down", shootProjectile) Works now? Edited July 8, 2017 by kieran Oops, local was still there.
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 4 minutes ago, kieran said: function shootProjectile() local vehicle = getPedOccupiedVehicle(Player) if ( getElementDimension ( vehicle ) == 1 ) then if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("vehicle_fire", "down", shootProjectile) Works now? No 1
kieran Posted July 8, 2017 Posted July 8, 2017 @Legend<3 idk a thing about projectiles, I will try make script though.
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 Just now, kieran said: @Legend<3 idk a thing about projectiles, I will try make script though. Thank You ... Look Here function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) -- Only create projectile if we are inside a vehicle if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end bindKey("vehicle_fire", "down", shootProjectile) this work fine ... but i need it work only in Dimension 1
Dimos7 Posted July 8, 2017 Posted July 8, 2017 function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) -- Only create projectile if we are inside a vehicle if(vehicle)then if getElementDimension(vehicle) == 1 then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("vehicle_fire", "down", shootProjectile)
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 2 minutes ago, Dimos7 said: function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) -- Only create projectile if we are inside a vehicle if(vehicle)then if getElementDimension(vehicle) == 1 then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("vehicle_fire", "down", shootProjectile) I Don't know how but Thanks it's Work The Question Is How can I add Timer ? Shot missel 1 TIME every 3 econds .. because i shout about 10 shots in 2 seconds ..
!#NssoR_) Posted July 8, 2017 Posted July 8, 2017 function shootProjectile() if ( getElementDimension(localPlayer) ~= 1 or isTimer(SpamTimer) ) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then createProjectile(vehicle, 19, getElementPosition(vehicle)) SpamTimer = setTimer(function () end,3 * 1000,1) end end bindKey("vehicle_fire", "down", shootProjectile)
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 7 minutes ago, !#NssoR_) said: function shootProjectile() if ( getElementDimension(localPlayer) ~= 1 or isTimer(SpamTimer) ) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then createProjectile(vehicle, 19, getElementPosition(vehicle)) SpamTimer = setTimer(function () end,3 * 1000,1) end end bindKey("vehicle_fire", "down", shootProjectile) Thank You Working <3 .. one more question .. if i need it only for sit == 0 function shootProjectile(seat, jacked) if ( getElementDimension(localPlayer) ~= 1 or isTimer(SpamTimer) or seat ~= 0 ) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then createProjectile(vehicle, 19, getElementPosition(vehicle)) SpamTimer = setTimer(function () end,3 * 1000,1) end end bindKey("vehicle_fire", "down", shootProjectile) it will be like this .. right ??
!#NssoR_) Posted July 8, 2017 Posted July 8, 2017 function shootProjectile() if ( getElementDimension(localPlayer) ~= 1 or isTimer(SpamTimer) or getPedOccupiedVehicleSeat(localPlayer) ~= 0 ) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then createProjectile(vehicle, 19, getElementPosition(vehicle)) SpamTimer = setTimer(function () end,3 * 1000,1) end end bindKey("vehicle_fire", "down", shootProjectile)
#BrosS Posted July 8, 2017 Posted July 8, 2017 11 minutes ago, Legend<3 said: Thank You Working <3 .. one more question .. if i need it only for sit == 0 function shootProjectile(seat, jacked) if ( getElementDimension(localPlayer) ~= 1 or isTimer(SpamTimer) or seat ~= 0 ) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then createProjectile(vehicle, 19, getElementPosition(vehicle)) SpamTimer = setTimer(function () end,3 * 1000,1) end end bindKey("vehicle_fire", "down", shootProjectile) it will be like this .. right ?? Nope , remove seat, jacked and use getPedOccupiedVehicleSeat i posted that before Nssor my internet is so :~ty
SkiZo Posted July 8, 2017 Author Posted July 8, 2017 13 minutes ago, !#NssoR_) said: function shootProjectile() if ( getElementDimension(localPlayer) ~= 1 or isTimer(SpamTimer) or getPedOccupiedVehicleSeat(localPlayer) ~= 0 ) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then createProjectile(vehicle, 19, getElementPosition(vehicle)) SpamTimer = setTimer(function () end,3 * 1000,1) end end bindKey("vehicle_fire", "down", shootProjectile) Thank You So Much <3 13 minutes ago, #BrosS said: Nope , remove seat, jacked and use getPedOccupiedVehicleSeat i posted that before Nssor my internet is so :~ty Thank You ! Working
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