jkub Posted December 7, 2008 Share Posted December 7, 2008 I am working on an interior script that uses more then 1 marker to spawnplayers different places and the second marker spawns the player back to the first markers destination I want the first marker to set the player to lvpd (wich it does) and the second one INSIDE THE LVPD INTERIOR to set the player to the atrium interior wich it just sets the player to the first markers destination.? im assuming its because "onMarkerHit" is already handled to the first function and will do any thing in the first function instead? i have no idea how to get this to work can u plz help me lvpd = createMarker ( -2521.1308, -623.9481, 133.1000, "cylinder", 1.5, 255, 255, 0, 150, getRootElement() ) attrium = createMarker ( 238.7158, 138.6332, 1003.0234, "arrow", 1.5, 0, 0, 255, 150, getRootElement() ) setElementDimension ( attrium, 18 ) setElementInterior ( attrium, 18, -238.1308, -623.9481, 133.1000 ) function lvpdhq ( hitPlayer, matchingDimension ) if getElementType ( hitPlayer )=="player" then spawnPlayer ( hitPlayer, 289.7703, 171.7460, 1007.1790 , 0, 0, 3, 0, nil ) end end addEventHandler ( "onMarkerHit", getRootElement(), lvpdhq ) addCommandHandler ( "lvpdhq", lvpd ) function atrium ( hitPlayer, matchingDimension ) if attrium then spawnPlayer ( hitPlayer, 1726.1370, -1645.2300, 20.2260, 0, 0, 18, 0, nil ) else return end end addEventHandler ( "onMarkerHit", attrium, atrium ) Link to comment
Gamesnert Posted December 7, 2008 Share Posted December 7, 2008 Ok so let me see: 1. With ANY marker you hit, you want to execute lvpdhq? (Line: 11) 2. This won't work I guess... You're executing a marker when you type "/lvpdhq". (Line: 12) 3. Might it not be better to use setElementPosition and setElementInterior instead of spawnPlayer? For as far as I know, spawnPlayer makes the player spawn inside the interior, but with full health. Even if he was actually damaged. (Line: 8 and 16) I guess point 1 already fixes what you need fixed. The other 2, are just things that are recommended to fix. Link to comment
50p Posted December 7, 2008 Share Posted December 7, 2008 I am working on an interior script that uses more then 1 marker to spawnplayers different places and the second marker spawns the player back to the first markers destination I want the first marker to set the player to lvpd (wich it does) and the second one INSIDE THE LVPD INTERIOR to set the player to the atrium interior wich it just sets the player to the first markers destination.? im assuming its because "onMarkerHit" is already handled to the first function and will do any thing in the first function instead? i have no idea how to get this to work can u plz help me ... 1st thing you have to do is think of how MTA events work. 2nd thing you must consider is how do you know which marker player hit? 3rd thing you should think of is where are you going to take the coords of teleportation? You should check if marker that you hit is the marker that you wanted? if source == lvpd then -- you just hit marker stored in variable -> lvpd -- so teleport me somewhere end Link to comment
jkub Posted December 8, 2008 Author Share Posted December 8, 2008 thanks 50 that seemed to work great im gonna look into this some more and check out some events Link to comment
jkub Posted December 9, 2008 Author Share Posted December 9, 2008 ya i now notice that the event "onMarkerHit" means it will be triggered by any marker... until i specify a specific marker such as 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