local root = getRootElement()
local this = getThisResource()
local resourceRoot = getResourceRootElement(this)
local localPlayer = getLocalPlayer()
local Marker = {}
funzioneAttiva = 0
addEventHandler("onClientResourceStart", resourceRoot,
function()
Marker[1] = createMarker(0, 0, 0, "corona", 5, 255, 0, 0) -- da definire le coordinate X Y Z
end
)
addEventHandler("onClientMarkerHit", root,
function(player, matchingDimension)
if not matchingDimension then return end
if player == localPlayer and isPedInVehicle(player) then
local vehicle = getPedOccupiedVehicle(player)
if source == Marker[1] and funzioneAttiva == 0 then
funzioneAttiva = 1
Jump()
setTimer(
function()
funzioneAttiva = 0
end
, 15000, 1)
end
end
end
)
function Jump ( key, keyState )
local vehicle = getPlayerOccupiedVehicle(getLocalPlayer())
if ( keyState == "down" ) and funzioneAttiva == 1 then
local x, y, z = getElementVelocity(vehicle)
setElementVelocity(vehicle, x, y, z + 0.2)
end
end
bindKey ( "z", "down", Jump )
bindKey ( "mouse2", "down", Jump )
Questo è per il jump, quando il player va sul marker si attiva per 15 sec il jump.