[MTA]revenngeR Posted September 6, 2009 Share Posted September 6, 2009 (edited) WARNING: Bad argument @ killtimer function ObjMissionText:killMissionText() -- kill any active timers killTimer(self._fadeTimer) -- LINE 136 -- kill active fading fadeText = false -- render invisible for k, v in ipairs(self._imageTbl) do guiSetVisible(v, false) guiSetAlpha(v, 0) end self._fadeAlpha = 1.0 self._textVisible = false end ERROR: ATTEMPT TO COMPARE NIL WITH NUMBER function callbackHit(theShape, matchingDimension) local id = "" if (objTimerUtils:getSpawned() and getElementType(source) == "player" and source == player) then id = tonumber(getElementData(theShape, "id")) if (id <= 100) then -- [b]THE ERROR[/b] objSpawnpoints:triggerPulse(id, true) objClientPlayer:setProtected(true) if (objClientPlayer:getGameState() == "STRoundStarted") then objSpawnpoints:lockToMarkerByID(objClientPlayer, id, true) objSpawnpoints:setSpawnpointID(id) bindKey("enter", "down", keyFunc) end end if (id >= 101 and id <= 499) then objClientVehicles:triggerBlip(id, "1", 255) end if (id >= 500 and id <= 699) then objLiftMarkers:triggerPulse(id, true) if (objClientPlayer:getGameState() == "STRoundStarted") then objLiftMarkers:lockToMarkerByID(objClientPlayer, id, true) bindKey("enter", "down", keyFunc) end end if (id >= 3001 and id <= 3499) then objRefuelMarkers:triggerPulse(id, true) end if (id >= 3500 and id <= 3999) then if (getPedOccupiedVehicle(source) ~= false) then if (getElementData(getPedOccupiedVehicle(source), "id") ~= false) then if (not objClientVehicles:getCanRepairByID(getElementData(getPedOccupiedVehicle(source), "id"))) then objTextManager:createInstructDsp({"closerepair", "blank"}) end end end objRepairMarkers:triggerPulse(id, true) end if (id >= 4000 and id <= 4100) then objWarfactoryMarkers:triggerPulse(id, true) if (objClientVehicles:isPlayerController(source) ~= false and objWarfactoryMarkers:isVehicleAllowed(source, id)) then objClientWarfactory:Process("funcWaitingTransfer", getPedOccupiedVehicle(source)) bindKey("space", "down", keyFunc) end end if (id >= 4101 and id <= 4199) then objAmmodepotMarkers:triggerPulse(id, true) end end end CAN SOMEONE HELP ME RESOLVE THESE ERROR/WARNING Edited September 6, 2009 by Guest Link to comment
50p Posted September 6, 2009 Share Posted September 6, 2009 We can't really help you because that's not all code that's responsible for "your" (if it was your code, you wouldn't ask that question here) variables. KillTimer throws a warning because self._fadeTimer is not a valid timer (simply, read the warning message). The error about comparing nil with number: you get that because id is not a number, it's nil... what it tell you is that theShape has no "id" custom data. Link to comment
subenji99 Posted September 6, 2009 Share Posted September 6, 2009 You didn't paste your event handler attached to your callbackHit function, but at a guess i'd say what's happening there is the function is being triggered on colshapes you didn't intend. Bear in mind that a lot of resources make use of colshapes, and if you attach your handler to the Root Element, your event will be triggered on any of them being hit. It's often best to attach to the root element of your own resource instead, or the currently loaded map if your gamemode's maps define colshapes. Link to comment
[MTA]revenngeR Posted September 6, 2009 Author Share Posted September 6, 2009 http://mta.pastebay.com/52311 There is the full client code. And it's not mine is it a crime to fix errors? PS: its a nightly build gamemode Link to comment
50p Posted September 6, 2009 Share Posted September 6, 2009 ATTEMPT TO COMPARE NIL WITH NUMBER I can't find any setElementData in this code. To get some data from element you first need to assign a value to it; otherwise you'll get nil. You need to debug it yourself (find setElementData, that sets the colshape "id"). Bad argument @ killtimer Same here... There is no self._fadeTimer. Find it and make sure it's not killed before execution gets to that point. 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