Jump to content

DayZ login warnings


Kush

Recommended Posts

Hello there, I am receiving errors with my DayZ 0.9.8a release I've got, its giving me these errors and I've got no clues why.

Error code:

[2016-07-21 23:55:05] WARNING: [DayZ]\DayZ\login.lua:186: Bad argument @ 'spawnPlayer' [Expected vector3 at argument 2, got boolean] 
[2016-07-21 23:55:05] WARNING: [DayZ]\DayZ\login.lua:189: Bad argument @ 'createColSphere' [Expected vector3 at argument 1, got boolean] 
[2016-07-21 23:55:05] WARNING: [DayZ]\DayZ\login.lua:191: Bad argument @ 'attachElements' [Expected element at argument 1, got boolean] 
[2016-07-21 23:55:05] WARNING: [DayZ]\DayZ\login.lua:192: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] 
[2016-07-21 23:55:05] WARNING: [DayZ]\DayZ\login.lua:193: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] 
[2016-07-21 23:55:05] WARNING: [DayZ]\DayZ\login.lua:229: Bad argument @ 'setElementModel' [Expected number at argument 2, got boolean] 

                spawnPlayer (player, x,y,z, math.random(0,360), skin, 0, 0) 
                fadeCamera (player, true) 
                setCameraTarget (player, 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]) 
                    setElementData(player,data[1],elementData) 
                end 
                setElementData(player,"logged_in",true) 
                setPedStat(source, 69, 0) 
                setPedStat(source, 70, 1000) 
                setPedStat(source, 71, 1000) 
                setPedStat(source, 72, 1000) 
                setPedStat(source, 73, 0) 
                setPedStat(source, 74, 1000) 
                setPedStat(source, 75, 0) 
                setPedStat(source, 76, 1000) 
                setPedStat(source, 77, 1000) 
                setPedStat(source, 78, 1000) 
                setPedStat(source, 79, 1000) 
                setPedStat(source, 80, 1000) 
                setPedStat(source, 81, 1000) 
    --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")) 

Suggestions on how to fix this?

Edited by Guest
Link to comment
We can't help you unless you post the full code.

There's an error with the player position, which will then also give you errors with the colShape, attachElements, and so on.

This is the full 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, math.random(0,360), skin, 0, 0)
                fadeCamera (player, true)
                setCameraTarget (player, 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])
                    setElementData(player,data[1],elementData)
                end
                setElementData(player,"logged_in",true)
                setPedStat(source, 69, 0)
                setPedStat(source, 70, 1000)
                setPedStat(source, 71, 1000)
                setPedStat(source, 72, 1000)
                setPedStat(source, 73, 0)
                setPedStat(source, 74, 1000)
                setPedStat(source, 75, 0)
                setPedStat(source, 76, 1000)
                setPedStat(source, 77, 1000)
                setPedStat(source, 78, 1000)
                setPedStat(source, 79, 1000)
                setPedStat(source, 80, 1000)
                setPedStat(source, 81, 1000)
    --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"))
--setElementModel(source,"skin")
 
setElementData(player,"admin",getAccountData(account,"admin") or false)
setElementData(player,"moderator",getAccountData(account,"moderator") or false)
 
end
addEvent("onPlayerDayZLogin", true)
addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin)
 
function playerRegister(username, pass, player)
    local number = math.random(table.size(spawnPositions))
    local x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3]
    spawnPlayer (player, x,y,z, math.random(0,360), 73, 0, 0)
    fadeCamera (player, true)
    setCameraTarget (player, player)
        playerCol = createColSphere(x,y,z,1.5)
        attachElements ( playerCol, player, 0, 0, 0 )
        setElementData(playerCol,"parent",player)
        setElementData(playerCol,"player",true)
        setPedStat(source, 69, 0)
        setPedStat(source, 70, 1000)
        setPedStat(source, 71, 1000)
        setPedStat(source, 72, 1000)
        setPedStat(source, 73, 0)
        setPedStat(source, 74, 1000)
        setPedStat(source, 75, 0)
        setPedStat(source, 76, 1000)
        setPedStat(source, 77, 1000)
        setPedStat(source, 78, 1000)
        setPedStat(source, 79, 1000)
        setPedStat(source, 80, 1000)
        setPedStat(source, 81, 1000)
    ----------------------------------
    --Player Items on Start
    for i,data in ipairs(playerDataTable) do
        if data[1] =="Bandage" then
            setElementData(player,data[1],2)
        elseif data[1] =="Painkiller" then
            setElementData(player,data[1],1)
        elseif data[1] =="MAX_Slots" then
            setElementData(player,data[1],8)
        elseif data[1] =="skin" then
            setElementData(player,data[1],73)
        elseif data[1] =="blood" then
            setElementData(player,data[1],12000)
        elseif data[1] =="temperature" then
            setElementData(player,data[1],37)
        elseif data[1] =="brokenbone" then
            setElementData(player,data[1],false)   
        elseif data[1] =="pain" then
            setElementData(player,data[1],false)
        elseif data[1] =="cold" then
            setElementData(player,data[1],false)
        elseif data[1] =="infection" then
            setElementData(player,data[1],false)
        elseif data[1] =="food" then
            setElementData(player,data[1],100)
        elseif data[1] =="thirst" then
            setElementData(player,data[1],100)
        elseif data[1] =="currentweapon_1" then
            setElementData(player,data[1],false)
        elseif data[1] =="currentweapon_2" then
            setElementData(player,data[1],false)   
        elseif data[1] =="currentweapon_3" then
            setElementData(player,data[1],false)   
        elseif data[1] =="bandit" then
            setElementData(player,data[1],false)   
        elseif data[1] =="humanity" then
            setElementData(player,data[1],2500)    
        else
            setElementData(player,data[1],0)
        end 
    end
        account = getAccount(username)
        local value = getAccounts()
        local value = #value
        setElementData(player,"playerID",value+1)
        setAccountData(account,"playerID",value+1)
        setElementData(player,"logged_in",true)
        createZombieTable (player)
end
addEvent("onPlayerDayZRegister", true)
addEventHandler("onPlayerDayZRegister", getRootElement(), playerRegister)
 
 
function saveAccounts () -- Save in the database
    local account = getPlayerAccount(source)
    if account then
    for i,data in ipairs(playerDataTable) do
        setAccountData(account,data[1],getElementData(source,data[1]))
    end
        local x,y,z =  getElementPosition(source)
        setAccountData(account,"last_x",x)
        setAccountData(account,"last_y",y)
        setAccountData(account,"last_z",z)
        --destroyElement(getElementData(source,"playerCol"))
        if getElementData(source, "playerCol") then
            destroyElement(getElementData(source, "playerCol"))
        end
    end 
    setElementData(source,"logged_in",false)
end
addEventHandler ( "onPlayerQuit", getRootElement(), saveAccounts )
 
function saveAccounts2 () -- Save in the database
for i, player in ipairs(getElementsByType("player")) do
    local account = getPlayerAccount(player)
    if account then
    for i,data in ipairs(playerDataTable) do
        setAccountData(account,data[1],getElementData(player,data[1]))
    end
        local x,y,z =  getElementPosition(player)
        setAccountData(account,"last_x",x)
        setAccountData(account,"last_y",y)
        setAccountData(account,"last_z",z)
    end 
    --setElementData(player,"logged_in",false)
end 
end
addEventHandler ( "onResourceStop", getRootElement(), saveAccounts2 )
 
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
local vehicleDataTable = {
{"MAX_Slots"},
{"Tire_inVehicle"},
{"Engine_inVehicle"},
{"fuel"},
{"Firewood"},
{"Bandage"},
{"Water Bottle"},
{"Pasta Can"},
{"Beans Can"},
{"Cereal"},
{"Box of Matches"},
{"M1911 Mag"},
{"M1911"},
{"M9 SD"},
{"Desert Eagle Mag"},
{"Winchester 1866"},
{"PDW"},
--{"Hunting Knife"},
{"Morphine"},
{"Hatchet"},
{"Poptarts"},
{"Soda Bottle"},
{"Empty Jerry Can"},
{"Full Jerry Can"},
{"Roadflare"},
{"Milk"},
{"PDW Mag"},
{"MP5A5 Mag"},
{"AK Mag"},
{"M4 Mag"},
{"Tear Gas"},
{"Grenade"},
{"Desert Eagle"},
{"Sawn-Off Shotgun"},
{"SPAZ-12 Combat Shotgun"},
{"MP5A5"},
{"Watch"},
{"Medic Kit"},
{"Heat Pack"},
{"Lee Enfield"},
--{"TEC-9"},
{"AK-47"},
--{"M136 Rocket Launcher"},
{"Blood Bag"},
{"GPS"},
{"Map"},
{"Toolbox"},
{"Wire Fence"},
{"Tire"},
{"Engine"},
{"M136 Rocket"},
{"CZ 550 Mag"},
{"Lee Enfield Mag"},
{"M4"},
{"CZ 550"},
--{"Heat-Seeking RPG"},
--{"C4"},
{"Infrared Goggles"},
{"Night Vision Goggles"},
{"Tent"},
{"Raw Meat"},
{"Cooked Meat"},
{"Camouflage Clothing"},
{"Ghillie Suit"},
{"Civilian Clothing"},
{"Bandit1 Clothing"},
{"Bandit2 Clothing"},
{"Military Clothing"},
{"Special Force Clothing"},
{"Survivor Clothing"},
{"Painkiller"},
{"Binoculars"},
{"Empty Water Bottle"},
Link to comment
Are you sure you are logged in and that the login panel logs you in correctly? I found no logIn function there. I am with my mobile so I cannot check it much.

I think you either are:

*Not logged in.

*Or you do not have any last position... Somehow.

I've got no clue, as far as i can when i press "Login" it dos spawn at last know location, but this only accure when new accounts is created :/

Link to comment
Are you sure you are logged in and that the login panel logs you in correctly? I found no logIn function there. I am with my mobile so I cannot check it much.

I think you either are:

*Not logged in.

*Or you do not have any last position... Somehow.

I've got no clue, as far as i can when i press "Login" it dos spawn at last know location, but this only accure when new accounts is created :/

How can the script get the Last known location when you registered for the first time.You should add a line to prevent the script from getting last known position when you register

Link to comment
Are you sure you are logged in and that the login panel logs you in correctly? I found no logIn function there. I am with my mobile so I cannot check it much.

I think you either are:

*Not logged in.

*Or you do not have any last position... Somehow.

I've got no clue, as far as i can when i press "Login" it dos spawn at last know location, but this only accure when new accounts is created :/

How can the script get the Last known location when you registered for the first time.You should add a line to prevent the script from getting last known position when you register

Oh sorry dident understand the the messages meaning, it dosent get the last know position when register, it gets the last know location when login in. I think i've fixed it aswell, as i do not receive any more errors now. Thanks for the assistance

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