Jump to content

Hospital fix


Recommended Posts

Posted

Hello,

I have downloaded a free hospital script but when i die.

I forget my weapons so i don't have any weapons.

Can somebody fix this maybe for me?

Sorry for bad English :P

addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619 ) 
        outputChatBox ( getPlayerName ( source ).." died and was transported at All Saints Hospital.") 
  
    end 
) 

Greetings,

Wesley

Posted

get the players weapons whilst alive and when they die check if they have those weapons, if not, give it to them using functions from the MTA wiki ;)

And now Aurora is back again, pm for more info.

Ex. Lead dev & L6 Staff at AUR, NGC, MTA RP & SAA.

Ex. Developer at Community of Social Gamers - CSG

Ex Founder of International Gaming Community - IGC and Union of Individual Players- UIP

9o6E8.png Ab-47

Posted

i suggest to add onPlayerQuit part too,

If they're dead and reconnect the timer continues

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
--server 
addEventHandler("onPlayerWasted", getRootElement(), function () 
    setElementData (source, "weapon0", getPedWeapon (source, 0)) 
    setElementData (source, "weapon1", getPedWeapon (source, 1)) 
    setElementData (source, "ammo0", getPedTotalAmmo (source, 0)) 
    setElementData (source, "ammo1", getPedTotalAmmo (source, 1)) 
    -- etc. 
    setTimer( spawnPlayer, 4000, 1, source, 1177.57, -1323.26, 14.1 ) 
    outputChatBox ( getPlayerName ( source ).." died and was transported at All Saints Hospital.") 
end) 
  
addEventHandler("onPlayerSpawn", getRootElement(), function() 
    local weapon0 = getElementData (source, "weapon0") 
    local weapon1 = getElementData (source, "weapon1") 
    local ammo0 = getElementData (source, "ammo0") 
    local ammo1 = getElementData (source, "ammo1") 
    giveWeapon (source, weapon0, ammo0, true) 
    giveWeapon (source, weapon1, ammo1, true) 
    --etc. 
    fadeCamera(source, true, 2.0) 
end) 

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