Jump to content

attempt to call global isPedDead (a nil value)


Recommended Posts

hi I want to check if the player is dead but it gives me an error

function savePlayerData(player)
   if (player) then
      local account = getPlayerAccount(player)
      if(isGuestAccount(account) == false) then
         local accountName = getAccountName(account)
         local playerLevel = getPlayerLevel(player)
         local playerEXP = getPlayerEXP(player)
         local tempEXP = getPlayerTempEXP(player)
         local barEXP = getPlayerBarEXP(player)
         local playerMoney = getPlayerMoney(player)
         local playerWeapons
         
         if(isPeadDead(player)) then
            playerWeapons = toJSON(player_weapons[player])
         else
            playerWeapons = convertWeaponsToJSON(player)
         end

      end 
   end
end

addCommandHandler("saveme",
    function(player)
       savePlayerData(player)
    end
)

Ads-z.png

 

Link to post

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