Jump to content
  • 0

Help please..


nik3231

Question

So i decided to make a scripted jump. This is how script looks like. (btw i just have to put corona marker at the chords i put in script?). Well..it doesn't work :P. Some help please. Ty.

Me = getLocalPlayer() 
Root = getRootElement() 
local screenWidth, screenHeight = guiGetScreenSize() 
  
function Main () 
marker1 = createMarker(x(3236.3000488281), y(-266.20001220703), z(16), "corona", pickupsize(80), 0, 0, 0, 0) 
marker2 = createMarker(x(X), y(X), z(X), "corona", pickupsize(X), 0, 0, 0, 0) 
  
addEventHandler ( "onClientMarkerHit", getRootElement(), MainFunction ) 
end 
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Main ) 
  
function MainFunction ( hitPlayer, matchingDimension ) 
vehicle = getPedOccupiedVehicle ( hitPlayer ) 
if hitPlayer ~= Me then return end 
  
   if source == marker1 then 
                setElementVelocity(vehicle, speedX(0.0), speedY(0.2), speedZ(2)) 
   end 
   if source == marker2 then 
      setElementVelocity(vehicle, speedX(X), speedY(X), speedZ(X)) 
   end 
  
end 

Link to comment

15 answers to this question

Recommended Posts

  • 0
Me = getLocalPlayer() 
local screenWidth, screenHeight = guiGetScreenSize() 
  
function Main () 
    marker1 = createMarker(3236.3000488281, -266.20001220703, 16, "corona", 80, 0, 0, 0, 0) 
  
    addEventHandler ( "onClientMarkerHit", getRootElement(), MainFunction ) 
end 
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Main ) 
  
function MainFunction ( hitPlayer, matchingDimension ) 
    local vehicle = getPedOccupiedVehicle ( hitPlayer ) 
    if (hitPlayer ~= Me) then return end 
    if source == marker1 then 
        setElementVelocity(vehicle, 0.0, 0.2, 2) 
    end 
end 

P.S: This should go in the "Scripting" section.

Link to comment
  • 0
I didn't meant where it printed that error, I meant IN WHICH FUNCTION.

P.S: You're creating a marker with size 80, that's really big.

Hmm...not sure what you really mean with "wich function". I lowered it.

P.S:Added this to scripting tutorials.

Link to comment
  • 0

The error is "bad argument @ setElementVelocity"? if so:

Me = getLocalPlayer() 
local screenWidth, screenHeight = guiGetScreenSize() 
  
function Main () 
    marker1 = createMarker(3236.3000488281, -266.20001220703, 16, "corona", 80, 0, 0, 0, 0) 
  
    addEventHandler ( "onClientMarkerHit", getRootElement(), MainFunction ) 
end 
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Main ) 
  
function MainFunction ( hitPlayer, matchingDimension ) 
    if (hitPlayer ~= Me) then return end 
    if (not isPedInVehicle(hitPlayer)) then return end 
    local vehicle = getPedOccupiedVehicle ( hitPlayer ) 
    if source == marker1 then 
        setElementVelocity(vehicle, 0.0, 0.2, 2) 
    end 
end 

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...