2013martin1212 Posted August 6, 2015 Share Posted August 6, 2015 I want to make a script which like an event like in gta v or in ffs but a bit different way if i am stand in to the marker then the marker was warp me to the event , i no how to do some parts but this is my time to try to make this event so please help. local myMarker = createMarker (-696.45972 960.47467 12.28255, "cylinder", 4, 0, 0, 255,255 ) --- Marker created function MarkerHit( hitElement, setElementPosition ) setElementPosition ( source, 0, 0, 0 ) end addEventHandler( "onMarkerHit", setElementPosition, MarkerHit ) ---* But i want to start a race map there and play a race resource but the play still works as well --* maybe i need to put to the other dimension i dont no ,if some one no the way to do it please help thanks. * But i want to start a race map there and play a race resource but the play still works as well * Maybe i need to put to the other dimension i dont no ,if some one no the way to do it please help thanks. Link to comment
MAB Posted August 6, 2015 Share Posted August 6, 2015 (edited) wrong parameter ... ( setElementPosition ) this should be dimen u want to check if the player and the marker on it or not addEventHandler( "onMarkerHit", [The marker that the function should happen when the player hit], MarkerHit ) setElementPosition... u wrote source.. but the source here is not the player it is the marker... example. "onPlayerJoin" event who is the source here? he is the player.. and "onVehicleEnter" event.. the source here is the Vehicle.. i hope u understood that,, Visit MTA SA Community and look for a race map there.. there are good maps there note to change the dimen you will need the setElementDimension .. the first parameter is the Element you want to change dimen of.. you can make it myMarker or hitElement ( must be put in the MarkerHit function to work with the hitElement ) and the second parameter here is the number of the dimen u want.. "int" means that the number you are going to put can't contain decimal number .. example .. setElementDimension (myMarker,1.5) -- Wrong setElementDimension (myMarker,1) -- correct hitElement parameter here is the Element (could be object, player or vehicle ) who hit the marker which could be the player so correct code is : local myMarker = createMarker (-696.45972 960.47467 12.28255, "cylinder", 4, 0, 0, 255,255 ) --- Marker created function MarkerHit( hitElement, dimen ) setElementPosition ( hitElement, 0, 0, 0 ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) Edited August 6, 2015 by Guest Link to comment
GTX Posted August 6, 2015 Share Posted August 6, 2015 * But i want to start a race map there and play a race resource but the play still works as well * Maybe i need to put to the other dimension i dont no ,if some one no the way to do it please help thanks. You are searching for a gamemode called multigamemode, if I understood you correctly. You most likely can't make it. This requires a lot of time and experience in Lua. You'll need several functions listed here. You won't need all if you're making regular race just: createMarker createObject setElementDimension spawnPlayer setElementPosition And maybe you'll need some more functions. You'll also need XML functions to get spawnpoints and checkpoints from it. I recommend you to check this viewtopic.php?f=108&t=83045#p755960 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