Jump to content
  • 0

help me.


Batista

Question

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

2 answers to this question

Recommended Posts

  • 0

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

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