wesleywillems17 Posted November 19, 2013 Share Posted November 19, 2013 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 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 Link to comment
Ab-47 Posted November 19, 2013 Share Posted November 19, 2013 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 Link to comment
xXMADEXx Posted November 19, 2013 Share Posted November 19, 2013 When the player dies, you an loop through their weapons, insert them into a table and then when the player spawns, check to see if the index exists and if it does give them their weapons backs. Link to comment
ViRuZGamiing Posted November 19, 2013 Share Posted November 19, 2013 i suggest to add onPlayerQuit part too, If they're dead and reconnect the timer continues Link to comment
TRANE152 Posted November 19, 2013 Share Posted November 19, 2013 --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) 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