Jump to content

REMOVED


Kush

Recommended Posts

Hello there, i've got a small issue with my group system, i've getting an error that i can't get a handle of, i've been sitting and trying to pass it for about an hour now, i'm new to "Lua" so this is all new for me. Here is the codes

WARNING CODE:

[21:21:04] WARNING: [DayZ]\GroupSystem\gServer.lua:413: Bad argument @ 'fromJSON' [Expected string at argument 1, got nil] 

LUA GROUP CODE:

Location with [*] is the problem i'm accuring while running.

function resavePlayerName(player) 
    local name = getPlayerName(player) 
    local accName = getAccountName(getPlayerAccount(player)) 
    local group = getAccountData(getPlayerAccount(player),"Group") 
    -- 
    local mTable = getGroupData(group,"Members") 
    [*]local mTable = fromJSON(mTable) or {} 
    local newMTable = {} 
    for k,v in ipairs( mTable ) do 
        local n,acc = v[1],v[2] 
        if acc == accName then 
            table.insert(newMTable,{name,acc}) 
        else 
            table.insert(newMTable,{n,acc}) 
        end 
    end 
    -- 
    setGroupData(group,"Members",toJSON(newMTable)) 
end 

Would be perfect if i could be getting this to run :) Cheers

what is the getGroupData, a selfmade function? and you are getting that message because there is no Table or any value within it.

Link to comment
Hello there, i've got a small issue with my group system, i've getting an error that i can't get a handle of, i've been sitting and trying to pass it for about an hour now, i'm new to "Lua" so this is all new for me. Here is the codes

WARNING CODE:

[21:21:04] WARNING: [DayZ]\GroupSystem\gServer.lua:413: Bad argument @ 'fromJSON' [Expected string at argument 1, got nil] 

LUA GROUP CODE:

Location with [*] is the problem i'm accuring while running.

function resavePlayerName(player) 
    local name = getPlayerName(player) 
    local accName = getAccountName(getPlayerAccount(player)) 
    local group = getAccountData(getPlayerAccount(player),"Group") 
    -- 
    local mTable = getGroupData(group,"Members") 
    [*]local mTable = fromJSON(mTable) or {} 
    local newMTable = {} 
    for k,v in ipairs( mTable ) do 
        local n,acc = v[1],v[2] 
        if acc == accName then 
            table.insert(newMTable,{name,acc}) 
        else 
            table.insert(newMTable,{n,acc}) 
        end 
    end 
    -- 
    setGroupData(group,"Members",toJSON(newMTable)) 
end 

Would be perfect if i could be getting this to run :) Cheers

what is the getGroupData, a selfmade function? and you are getting that message because there is no Table or any value within it.

As i dident get it to work properly, i removed this, and started another one, i got that one i'm using now to function.

Thanks for the reply tho :)

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