Jump to content

Hi GuYs iwant someone to help me with markers code


Randomnob

Recommended Posts

Posted

iwant acode who make you when you hiton it make u jump for another marker like gangwars server in the bases u can jump from the floor1 in the base to the floor 3 without stairs + where iwant to put the code

Posted

You can use the following functions for that, it's not that hard trust me!

createMarker -- to create the jumping marker 
onMarkerHit -- whent he player walks into the marker 
setElementPosition -- move the player 

Thats all!

Posted

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?

Posted

sorry the code

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

Posted

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!

Posted

and if u can edit my another code :D

setElementPosition ( element theElement, float 2821.3000488281, float 1340.3000488281, float 65.099998474121 [, bool warp = true ]

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

Posted

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

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

Posted

OMG say 300 player xD do u want the server ip in a pm to know about anything iam talking icrated abase and iwant just my base members can use the marker

Posted

The base member has a skin - team or elementData? Just let it trigger it on the skin then.

@denny, yes I did. Cause of the fact thats its a gangserver, not a RP or what ever. :3 So there will only be 2 or 3 marker's ingame.

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