Hola tienen alguna idea de este error ?
Hey you have some idea of this error?
login.lua:292: Bad argument @ 'giveWeapon' [Expected number at argument 3, got boolean]
survivorSystem.lua:560: Bad argument @ 'giveWeapon' [Expected number at argument 3, got boolean]
-----survivorSystem.lua
function rearmPlayerWeapon (weaponName,slot)
takeAllWeapons (source)
local ammoData,weapID = getWeaponAmmoType (weaponName)
if getElementData(source,ammoData) <= 0 then triggerClientEvent (source, "displayClientInfo", source,"Rearm",shownInfos["nomag"],89, 161, 58, 255) return end
setElementData(source,"currentweapon_"..slot,weaponName)
local weapon = getElementData(source,"currentweapon_1")
if weapon then
local ammoData,weapID = getWeaponAmmoType (weapon)
giveWeapon(source,weapID,getElementData(source,ammoData), false )
end
local weapon = getElementData(source,"currentweapon_2")
if weapon then
local ammoData,weapID = getWeaponAmmoType (weapon)
giveWeapon(source,weapID,getElementData(source,ammoData), false )
end
local weapon = getElementData(source,"currentweapon_3")
if weapon then
local ammoData,weapID = getWeaponAmmoType (weapon)
giveWeapon(source,weapID,getElementData(source,ammoData), false )
end
if elementWeaponBack[source] then
detachElementFromBone(elementWeaponBack[source])
destroyElement(elementWeaponBack[source])
elementWeaponBack[source] = false
end
if elementWeaponBack[source] then
detachElementFromBone(elementWeaponBack[source])
destroyElement(elementWeaponBack[source])
elementWeaponBack[source] = false
end
setElementModel(source, getElementData(source,"skin"))
end
addEvent("onPlayerRearmWeapon",true)
addEventHandler("onPlayerRearmWeapon",getRootElement(),rearmPlayerWeapon)
-----login.lua
function playerLogin(username, pass, player)
local playerID = getAccountData(getPlayerAccount(player),"playerID")
account = getPlayerAccount(player)
local x,y,z = getAccountData(account,"last_x"),getAccountData(account,"last_y"),getAccountData(account,"last_z")
local skin = getAccountData(account,"skin")
createZombieTable (player)
if getAccountData(account,"isDead") then
spawnDayZPlayer(player)
return
end
spawnPlayer (player, x,y,z+0.5, math.random(0,360), skin, 0, 0)
setElementFrozen(player, true)
fadeCamera (player, true)
setCameraTarget (player, player)
setTimer( function(player)
if isElement(player) then
setElementFrozen(player, false)
end
end,500,1,player)
playerCol = createColSphere(x,y,z,1.5)
setElementData(player,"playerCol",playerCol)
attachElements ( playerCol, player, 0, 0, 0 )
setElementData(playerCol,"parent",player)
setElementData(playerCol,"player",true)
for i,data in ipairs(playerDataTable) do
local elementData = getAccountData(account,data[1])
if not elementData then
if data[1] == "brokenbone" or data[1] == "pain" or data[1] == "cold" or data[1] == "infection" or data[1] == "currentweapon_1" or data[1] == "currentweapon_2" or data[1] == "currentweapon_3" or data[1] == "bandit" then
elementData = elementData
else
elementData = 0
end
end
setElementData(player,data[1],elementData)
end
setElementData(player,"logedin",true)
--Weapons
--Old Weapons
local weapon = getElementData(player,"currentweapon_1")
if weapon then
local ammoData,weapID = getWeaponAmmoType (weapon)
giveWeapon(player,weapID,getElementData(player,ammoData), true )
end
local weapon = getElementData(player,"currentweapon_2")
if weapon then
local ammoData,weapID = getWeaponAmmoType (weapon)
giveWeapon(player,weapID,getElementData(player,ammoData), false )
end
local weapon = getElementData(player,"currentweapon_3")
if weapon then
local ammoData,weapID = getWeaponAmmoType (weapon)
giveWeapon(player,weapID,getElementData(player,ammoData), false )
end
setElementModel(player, getElementData(player,"skin"))
setElementData(player,"admin",getAccountData(account,"admin") or false)
setElementData(player,"supporter",getAccountData(account,"supporter") or false)
triggerClientEvent(player, "onClientPlayerDayZLogin", player)
end
addEvent("onPlayerDayZLogin", true)
addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin)
Hay Solucion ?
Ayuda u.u Muchas gracias!!
-----------------------------------
No solution?
Please help!!!!!!