jawwel Posted March 31, 2018 Posted March 31, 2018 function signUpToTDM(plr) if (tonumber(getPlayersInDimension(860)) >= 1) then outputChatBox("TDM are in progress, please, wait for them to finish and re-try", plr, 255, 255, 0) return end if (not signedPlayers[plr]) then table.insert(signingPlayers, plr) signedPlayers[plr] = true outputChatBox("You have joined TDM! Try get as many team kills as possible!", plr, 255, 255, 0) outputChatBox("/leave to cancel TDM.", plr, 255, 255, 0) for k, v in ipairs(signingPlayers) do outputChatBox(""..#signingPlayers.."/"..playerLimit.." are now signed up", v, 255, 255, 0) end if (#signingPlayers == playerLimit) then setTimer(stopDx, 50, 1) warpPlayersToField() destroyMarker() timeOutTimer = setTimer(timeOutEvent, tonumber(timeToFinish), 1) timeOut = false for k, v in pairs(signingPlayers) do if (isElement(v)) then triggerClientEvent(v, "TDM.Countdown", v) end end end end end whats wrong ? table index nil
Hoffmann Posted March 31, 2018 Posted March 31, 2018 (edited) I'm not sure if this line makes sense: if (tonumber(getPlayersInDimension(860)) >= 1) then It supposed to be if (tonumber(getPlayersInDimension(plr)) >= 1) then If I'm not wrong. Write number of line where error appears. Edited March 31, 2018 by NeverUnbeatable
Moderators Patrick Posted March 31, 2018 Moderators Posted March 31, 2018 Maybe: Change this: for k, v in pairs(signingPlayers) do if (isElement(v)) then triggerClientEvent(v, "TDM.Countdown", v) end end To this: for k, v in ipairs(signingPlayers) do if (isElement(v)) then triggerClientEvent(v, "TDM.Countdown", v) end end community profile | map converters | map images | pDownloader | pAttach | model encrypter
jawwel Posted March 31, 2018 Author Posted March 31, 2018 the error is here: table.insert(signingPlayers, plr) signedPlayers[plr] = true
Moderators Patrick Posted March 31, 2018 Moderators Posted March 31, 2018 Maybe the signedPlayers or signingPlayers are not definied as table before. community profile | map converters | map images | pDownloader | pAttach | model encrypter
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