PARKAH Posted August 8, 2013 Posted August 8, 2013 addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619 ) outputChatBox ( getPlayerName ( source ).." died and lost his/her clothes on the way to All Saints Hospital.") end ) What needs to be added to this to make it save your skin on death?
motax Posted August 8, 2013 Posted August 8, 2013 addEventHandler( "onPlayerWasted", getRootElement( ), function() skin = getElementModel ( source ) setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619,0,skin ) end ) Do you mean something like this?
PARKAH Posted August 8, 2013 Author Posted August 8, 2013 Yes thanks! What can be added to that to make players weapons save on death?
TAPL Posted August 8, 2013 Posted August 8, 2013 Yes thanks! What can be added to that to make players weapons save on death? -- by Solidsnake14. local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end )
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