Jump to content

Hi GuYs iwant someone to help me with markers code


Randomnob

Recommended Posts

imaked the code with corona markek

marker createMarker ( float 2806.6999511719, float 1371.0999755859, float 10 [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement() ] )

put where ill put the code?

Link to comment

Ahh you're not getting something from the wiki. The float is the type of the element you've to provide. Use it like this;

marker = createMarker ( 2806.6999511719, 1371.0999755859, 10, "corona", 4, 0, 0, 255, 255); 

And just place it on the first line of your script!

Link to comment
local marker = createMarker ( 2806.6999511719, 1371.0999755859, 10, "corona", 4, 0, 0, 255, 255); 
  
addEventHandler ( "onMarkerHit", marker, 
function (hitElement) 
if (getElementType ( hitElement ) == "player") then 
setElementPosition ( hitElement, 2821.3000488281, 1340.3000488281, 65.099998474121, true ) 
end 
end) 
  

I'm only helping you this time, after that you need to learn for yourself. visit this link: https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809

Good luck.

Link to comment

try this

addEventHandler("onMarkerHit", root, 
    function ( hitElement ) 
        if ( source == marker and getElementType ( hitElement ) == "player" )  then -- if the marker = markername 
            setElementPosition( hitElement, 2821.3000488281, 1340.3000488281, 65.099998474121 ); 
        end 
    end 
); 

local marker = createMarker ( 2806.6999511719, 1371.0999755859, 10, "corona", 4, 0, 0, 255, 255); 
  
addEventHandler ( "onMarkerHit", marker, 
function (hitElement) 
if (getElementType ( hitElement ) == "player") then 
setElementPosition ( hitElement, 2821.3000488281, 1340.3000488281, 65.099998474121, true ) 
end 
end) 
  

I'm only helping you this time, after that you need to learn for yourself. visit this link: https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809

Good luck.

Off topic: You know.... I NEVER followed any tut of lua... O_O" kinda weird...

Link to comment
try this
addEventHandler("onMarkerHit", root, 
    function ( hitElement ) 
        if ( source == marker and getElementType ( hitElement ) == "player" )  then -- if the marker = markername 
            setElementPosition( hitElement, 2821.3000488281, 1340.3000488281, 65.099998474121 ); 
        end 
    end 
); 

local marker = createMarker ( 2806.6999511719, 1371.0999755859, 10, "corona", 4, 0, 0, 255, 255); 
  
addEventHandler ( "onMarkerHit", marker, 
function (hitElement) 
if (getElementType ( hitElement ) == "player") then 
setElementPosition ( hitElement, 2821.3000488281, 1340.3000488281, 65.099998474121, true ) 
end 
end) 
  

I'm only helping you this time, after that you need to learn for yourself. visit this link: https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809

Good luck.

Off topic: You know.... I NEVER followed any tut of lua... O_O" kinda weird...

I didn't neither, also, I posted already a valid code, and helped him further. Also my way is faster since I'm attaching the event direclty to the marker, you are attaching it to the "root" so every marker in the server, after that when someone is hitting it it will look for that marker if it matches with the created marker, let's say, he's having 50 players in his server, with a costum housesystem, and map-created markers, some players are hitting the marker, and voila, it will chek if it's the created marker.

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