add more functions
Example
-- dead and diad
addEventHandler ("onPlayerWasted",root,
function()
if isPedDead(source) then return end
local id = getPlayerData (source,"userinfo","userid")
local x,y,z = getElementPosition(source)
local r,g,b = source:getNametagColor()
local int,dim = getElementInterior(source),getElementDimension(source)
local money,bank = source:getMoney(), getPlayerData (source,"userinfo","userbank")
local skin = getElementModel(source)
sql.Exec ("UPDATE userinfo SET userX = ?, userY = ?, userZ = ?, userR = ?, userG = ?, userB = ?,userskin= ?, userdim = ?, userint = ?, usermoney = ?, userbank =?, userfirstjoin = ? WHERE userid = ? ",x,y,z,r,g,b,skin,int,dim,money,bank,0,id)
for i = 1 , 12 do
setPlayerData (source, "userinfo","userweapon_"..i,getPedWeapon(source,i) )
setPlayerData(source,"userinfo","userammo_"..i,getPedTotalAmmo(source,i))
end
end
)
-- login
addEventHandler ("onPlayerLogin",root,
function()
local weapon = {}
local wep,ammo = {},{}
local data_weapon,data_ammo = {},{}
for i = 1, 12 do
data_weapon[i], data_ammo[i] = tonumber (getPlayerData (source,"userinfo","userweapon_"..i)),tonumber(getPlayerData (source,"userinfo","userammo_"..i))
wep[i],ammo[i] = data_weapon[i], data_ammo[i]
giveWeapon (source,wep[i],ammo[i])
end
end
)