Jump to content
  • 0

Help please..


nik3231

Question

Posted

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 

15 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted

in that "black" thingy when you start MTA server...it says something about WARNINGS: and bag argumets etc...

when i connect to my private server i can't do nothing...if i try to open my map screen freeze...

  • 0
Posted
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.

  • 0
Posted

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 

  • 0
Posted

Expected element at argument 1, got string 'checkpoint (27)

and

Bad argument @ 'setMarkerTarget' [string "edf/edf.lua"]

this 2 are the problems...

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