Batista Posted November 27, 2011 Share Posted November 27, 2011 Hello all, I read wiki and I do respawn script at hospital when player dead, but the probleme that it didn't save skin and weapons when I dead, please someone help me how to fix this? This is my script: addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619 ) end ) Thanks. Link to comment
0 12p Posted November 27, 2011 Share Posted November 27, 2011 Here you have documentation so you can understand how all this works: https://wiki.multitheftauto.com/wiki/GetPedWeapon https://wiki.multitheftauto.com/wiki/SpawnPlayer https://wiki.multitheftauto.com/wiki/GetPedTotalAmmo https://wiki.multitheftauto.com/wiki/Weapons http://lua-users.org/wiki/TablesTutorial addEventHandler( "onPlayerWasted", getRootElement( ), function() local simpleTable = { } --Create a table to store all the weapon data for i = 0,11 do simpleTable[1][i] = getPedWeapon ( source, i ) --Retrieve all weapons and store them in the table simpleTable[2][i] = getPedTotalAmmo ( source, i ) --Retrieve the ammo of each weapon and store them in the table end setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619, rot, skin ) --You must define "rot" and "skin", this won't work just like that. for i = 0,11 do giveWeapon ( source, simpleTable[1][i], simpleTable[2][i], false ) end end ) PS. Next time, go to Scripting forum, please. Link to comment
0 Batista Posted November 27, 2011 Author Share Posted November 27, 2011 ok, thanks Benxamix Link to comment
Question
Batista
Hello all,
I read wiki and I do respawn script at hospital when player dead, but the probleme that it didn't save skin and weapons when I dead, please someone help me how to fix this?
This is my script:
Thanks.
Link to comment
2 answers to this question
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