DSUSP Posted July 24, 2018 Share Posted July 24, 2018 (edited) Hello everyone! Today I experienced some problems (bad arguments). Because of that problem my resource automatically stopping when redo a map. Follow the code below; ERROR: newresource/server/server.lua:663: bad argument #1 to 'ipairs' (table expected, got no value) Stopping new resource Lua code here; function meF5(source) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local account = getPlayerAccount( source ) local mmapwins = getAccountData( account, map ) or 0 local mname = getAccountData ( account, "nick" ) or getPlayerName (source) local mkills = getAccountData ( account, ""..map.."-kills" ) or 0 setElementData( source,"mwins", mmapwins) setElementData( source,"mname", mname ) setElementData( source,"mkills", mkills ) setElementData(source,"whokilledme", "#ffffff") end function topmap( player, command ) tablo = {} for _, v in pairs(tablo) do if (_==10)then break end table.insert ( tablo, { name = v.name, data = v.data, kills = v.kills, ulkeyazi = v.ulkeyazi } ) end triggerClientEvent ( "returnTable", getRootElement(), tablo ) end addEventHandler ( 'onMapStarting', root, topmap) -- function alalalal() local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) setElementData(source,"mapne", map) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick" ) or getAccountName ( v ), data = getAccountData ( v, map ) or 0, kills = getAccountData ( v, ""..map.."-kills" ) or 0, ulkeyazi = getAccountData ( v, "CT" ) or "ZZ" } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) --return tableOrder triggerClientEvent ( "returnTable", getRootElement(), tableOrder ) end Please help me fixing this, thanks in advance! Edited July 24, 2018 by DSUSP Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now