Jump to content

I need help!


Recommended Posts

Posted

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!

Posted

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.

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted

That doesn't make any sense, stop replying when you have no idea please.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I just use

string getElementZoneName ( element theElement, [bool citiesonly=false] ) 

Then spawn them depending on what it returns.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...