GamerDeMTA Posted July 28, 2013 Share Posted July 28, 2013 Hey! I need help this time, in how to warp a person when he dies to the nearest hospital. I only know I need to use onPlayerWasted setElementPosition and more things, what I need is how to do that is to the Nearest Hospital! Link to comment
iMr.3a[Z]eF Posted July 28, 2013 Share Posted July 28, 2013 spawnPlayer "onPlayerWasted" Link to comment
GamerDeMTA Posted July 28, 2013 Author Share Posted July 28, 2013 And how to do it to the nearest Hospital? Link to comment
iMr.3a[Z]eF Posted July 28, 2013 Share Posted July 28, 2013 You mean spawn the player when he wasted to the nearest Hospital Link to comment
iMr.3a[Z]eF Posted July 28, 2013 Share Posted July 28, 2013 I really don't know how but you can do this: hospitals = { [1] = 113,43294, 134,23849, 124.532, [2] = 123.324523, 3256.136373, 246.234265 } function autoRespawn ( ) if isPlayerDead(source) then spawnPlayer(source, math.random([1],[2])) end end addEventHandler( "onPlayerWasted", getRootElement(), autoRespawn) This code will spawn the player when he wasted to random hospitals, the position is random Change them to the hospital's position, and if you want to add one or tow more hospitals, tell me i'll show you how. Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 That doesn't make any sense, stop replying when you have no idea please. Link to comment
GamerDeMTA Posted August 2, 2013 Author Share Posted August 2, 2013 how i do it?? sorry for this 'bump'. Link to comment
Sasu Posted August 2, 2013 Share Posted August 2, 2013 See this post: viewtopic.php?f=91&t=61094 Link to comment
Baseplate Posted August 2, 2013 Share Posted August 2, 2013 Make a table of hospitals coordinates, try to use getDistanceBetween3D between the hospital and player's position, then spawn the player there. Link to comment
OGF Posted August 3, 2013 Share Posted August 3, 2013 I just use string getElementZoneName ( element theElement, [bool citiesonly=false] ) Then spawn them depending on what it returns. 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