Randomnob Posted August 14, 2013 Share Posted August 14, 2013 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 Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 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! Link to comment
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 thnx guy u r the most active guy in the foroum ty and ill try it and coming to u Link to comment
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 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
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 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() ] ) Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 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
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 u mean meta iam a noob ihave amap created by me Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 Not in the meta, in a .lua file. Link to comment
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 and if u can edit my another code setElementPosition ( element theElement, float 2821.3000488281, float 1340.3000488281, float 65.099998474121 [, bool warp = true ] Link to comment
denny199 Posted August 14, 2013 Share Posted August 14, 2013 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
tosfera Posted August 14, 2013 Share Posted August 14, 2013 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
denny199 Posted August 14, 2013 Share Posted August 14, 2013 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
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 OMG say 300 player 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 Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 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. Link to comment
Randomnob Posted August 14, 2013 Author Share Posted August 14, 2013 one of my friend gaved me the right code he used it in his base now where to type it how to make the lua? iam a noobXnoob Link to comment
Castillo Posted August 14, 2013 Share Posted August 14, 2013 https://wiki.multitheftauto.com/wiki/Sc ... troduction https://wiki.multitheftauto.com/wiki/Meta.xml https://wiki.multitheftauto.com/wiki/Resources Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now