Jump to content

Scripters Game


ProDMRac3r

Recommended Posts

Meta.xml Code

<meta> 
    <info author="YOsse" version="1.2" name="Hosptial" type="script" /> 
  
    <script src="hospital.lua" type="client" /> 
  
  
</meta> 

Scripters Only Can Fine .lua Codes

Players :

Solidsnake14

Zango

Citizen

50p

Ransom

Dr.Dre

Mr.Hankey

proracer

eAi

May Like May Not :)

Link to comment
  • Moderators

So if you ask a sytem to respawn the player to the nearest hospital ( like the single ) use this ( I just finished to make it )

spawnsHospitals = {{X,Y,Z,RZ}} 
spawnsHospitals[1] = {X=1177.4658203125,Y=-1323.8505859375,Z=14.072093963623,RZ=272.34698486328} 
spawnsHospitals[2] = {X=2033.337890625,Y=-1415.2353515625,Z=16.9921875,RZ=136.29571533203} 
spawnsHospitals[3] = {X=-2660.431640625,Y=633.8486328125,Z=14.453125,RZ=181.82925415039} 
spawnsHospitals[4] = {X=1578.947265625,Y=1768.3779296875,Z=10.8203125,RZ=93.712066650391} 
spawnsHospitals[5] = {X=1876.330078125,Y=2237.36328125,Z=11.125,RZ=5.7651672363281} 
spawnsHospitals[6] = {X=1244.9228515625,Y=332.85546875,Z=19.5546875,RZ=339.0514831543} 
spawnsHospitals[7] = {X=-321.7744140625,Y=1057.1728515625,Z=19.7421875,RZ=310.25588989258} 
spawnsHospitals[8] = {X=-1514.6015625,Y=2525.173828125,Z=55.780910491943,RZ=4.556640625} 
  
function playerKilled( ) 
    setTimer( respawnToNearestHospital, 5000, 1, source ) 
end 
addEventHandler("onPlayerWasted", getRootElement(), playerKilled ) 
  
function respawnToNearestHospital( thePlayer ) 
    local x, y, z = getElementPosition( thePlayer ) 
    tableDist = {{index,dist}} 
    for k,i in ipairs ( spawnsHospitals ) do 
        local x2 = spawnsHospitals[k]["X"] 
        local y2 = spawnsHospitals[k]["Y"] 
        local dis = getDistanceBetweenPoints2D( x, y, x2, y2 ) 
        tableDist[k] = {index=k,dist=dis} 
    end 
    local goodK = -1 
    for l,j in ipairs( tableDist ) do 
        if ( l == 1 ) then  
            goodK = 1 
        else 
            local DIST1 = tableDist[goodK]["dist"] 
            local DIST2 = tableDist[l]["dist"] 
            if ( DIST2 < DIST1 ) then  
                goodK = l  
            end 
        end 
    end 
    if ( goodK == -1 ) then return end 
    spawnPlayer( thePlayer, spawnsHospitals[goodK]["X"], spawnsHospitals[goodK]["Y"], spawnsHospitals[goodK]["Z"] ) 
    setPedRotation( thePlayer, spawnsHospitals[goodK]["RZ"] ) 
end 

I already tested it and it works very well !

Link to comment
  • Moderators
How Did You Found My Codes ????

I don't found this code, I make it my self, and I get all hospitals positions for you ( near 1hour of work in total )

Congratulations!

You Win Connect To [ADD][iG]..::Redbull::.. |Invasion Gaming| Only DM

I Will Send You 200000 Dollar

And Some Teams And Admin

I really don't care about it.

Or He Will Win 500$ From My Earn Money
:P

maybe 10$ ? xD:whistle:

Link to comment

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...