Jump to content

Hi, help me with this script please...


y453bh

Recommended Posts

bindKey -- Jump Key
isPedInVehicle -- Check From Player if him in vehicle
getPedOccupiedVehicle -- get vehicle player
getElementVelocity -- get velocity
setElementVelocity -- set velocity
setTimer -- timer for jummping 

but for touching building ( real ) , you can create marker or colshape in a buldings and use 'onMarkerHit' or 'onColshapeHit'

Link to comment
Just now, Infinity-War said:

bindKey -- Jump Key
isPedInVehicle -- Check From Player if him in vehicle
getPedOccupiedVehicle -- get vehicle player
getElementVelocity -- get velocity
setElementVelocity -- set velocity
setTimer -- timer for jummping 

but for touching building ( real ) , you can create marker or colshape in a buldings and use 'onMarkerHit' or 'onColshapeHit'

I appreciate ur help but I dont know how to script.. 

help!

Link to comment
-- # Client Side

local State , Seconds = false , 5

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		local vehType = getVehicleType(vehicle)
		if vehType == "Plane" or vehType == "Helicopter" then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

 

Link to comment
10 minutes ago, Infinity-War said:

-- # Client Side

local State , Seconds = false , 5

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		local vehType = getVehicleType(vehicle)
		if vehType == "Plane" or vehType == "Helicopter" then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

 

 

I jump and turn the car 90 degrees in the air for hiting the wall, once I'm in the wall I press many times the shift key but It doesn't let me to jump without limits, help me please!!

Edited by y453bh
Link to comment
-- # Client Side

local State , Seconds , MaxZPosition = false , 5 , 10

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		if ( getGroundPosition ( Vector3 ( getElementPosition ( vehicle ) ) ) > MaxZPosition ) then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

try this

Link to comment
Just now, Infinity-War said:

-- # Client Side

local State , Seconds , MaxZPosition = false , 5 , 10

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		if ( getGroundPosition ( Vector3 ( getElementPosition ( vehicle ) ) ) > MaxZPosition ) then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

try this

Its not working @Infinity-War

Link to comment
1 minute ago, Infinity-War said:

i don't understand man :( , you have an exmaple ?

All fine with the script but, what I want is that when I'm like this on a building or wall, It lets me do the jump without time restriction. That way I can press the key several times to go flying through the air.

wallrideSCREEN3.jpg

Link to comment
  • Moderators
1 hour ago, y453bh said:

I appreciate ur help but I dont know how to script.. 

13 minutes ago, y453bh said:

Help community!!

This section is for learning to script, feel free to make use of that. Unfortunately scripting requests are not allowed in this section.

Please read the section rules:

 

 

Link to comment
  • Moderators
4 minutes ago, y453bh said:

@Infinity-War Already gave you the example man, I need your help please!!

Then use a private message with him... leave me out of it.

 

Locked, reason: scripting request

Edited by IIYAMA
Link to comment
  • IIYAMA locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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