GamerDeMTA Posted July 28, 2013 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!
GamerDeMTA Posted July 28, 2013 Author Posted July 28, 2013 And how to do it to the nearest Hospital?
iMr.3a[Z]eF Posted July 28, 2013 Posted July 28, 2013 You mean spawn the player when he wasted to the nearest Hospital
iMr.3a[Z]eF Posted July 28, 2013 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.
Castillo Posted July 28, 2013 Posted July 28, 2013 That doesn't make any sense, stop replying when you have no idea please.
Baseplate Posted August 2, 2013 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.
OGF Posted August 3, 2013 Posted August 3, 2013 I just use string getElementZoneName ( element theElement, [bool citiesonly=false] ) Then spawn them depending on what it returns.
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