Speak Posted January 25, 2013 Share Posted January 25, 2013 como eu corrijo esse bug WARNING: Hidden-xrs.lua:34:Bad argument @'removeEventHandle local me = getLocalPlayer() local maxStreamedPlayers = 16 sx,sy = guiGetScreenSize() function isDM() for i, pu in pairs (getElementsByType("racepickup")) do local puType = getElementData(pu, "type") if (puType == "vehiclechange") then local puVehicle = tonumber(getElementData(pu, "vehicle")) if puVehicle == 425 then return true end end end return false end enabled = false function toggleHideAll() startTimess = getTickCount() setElementData(me, "hideAllPlayers", not getElementData(me, "hideAllPlayers"), false) if enabled == false then removeEventHandler("onClientRender",getRootElement(),mapwindowa) removeEventHandler("onClientRender",getRootElement(),carclose) removeEventHandler("onClientRender",getRootElement(),caropen) removeEventHandler("onClientRender",getRootElement(),wateropen) removeEventHandler("onClientRender",getRootElement(),waterclose) addEventHandler("onClientRender",getRootElement(),mapwindowda) else removeEventHandler("onClientRender",getRootElement(),mapwindowda) removeEventHandler("onClientRender",getRootElement(),carclose) removeEventHandler("onClientRender",getRootElement(),caropen) removeEventHandler("onClientRender",getRootElement(),wateropen) removeEventHandler("onClientRender",getRootElement(),waterclose) addEventHandler("onClientRender",getRootElement(),mapwindowa) end enabled = not enabled end bindKey("O", "down", toggleHideAll) function getPlayers() return getElementsByType("player") end streamedPlayers = {} function hidePlayer(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then if getElementModel(vehicle) == 425 then showPlayer(player) return end if getElementDimension(vehicle) ~= 999 or getElementDimension(player) ~= 999 or getElementInterior(player) ~= 999 or getElementInterior(vehicle) ~= 999 then setElementDimension(vehicle, 999) setElementDimension(player, 999) setElementInterior(vehicle, 999) setElementInterior(player, 999) end end end function showPlayer(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then if getElementDimension(vehicle) ~= 0 or getElementDimension(player) ~= 0 or getElementInterior(player) ~= 0 or getElementInterior(vehicle) ~= 0 then setElementDimension(vehicle, 0) setElementDimension(player, 0) setElementInterior(vehicle, 0) setElementInterior(player, 0) end end end setTimer( function() streamedPlayers = {} if getElementData(me, "state") ~= "alive" then for id, player in ipairs(getPlayers()) do if getElementData(player,"state") == "alive" then showPlayer(player) end end else if getElementData(me, "hideAllPlayers") and isDM() then for id, player in ipairs(getPlayers()) do if player ~= me then hidePlayer(player) end end return end local x2,y2,z2 = getElementPosition(me) for id, player in ipairs(getPlayers()) do if player ~= me then local x1,y1,z1 = getElementPosition(player) local d = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2 ) if d < 200 then table.insert(streamedPlayers, {player, d }) end end end if #streamedPlayers > maxStreamedPlayers then table.sort(streamedPlayers, function(a,b) return a[2] < b[2] end) for i = 1, maxStreamedPlayers do showPlayer(streamedPlayers[i][1]) end for i = maxStreamedPlayers+1, #streamedPlayers do hidePlayer(streamedPlayers[i][1]) end else for id, player in ipairs(getPlayers()) do if getElementData(player, "state") == "alive" then showPlayer(player) end end end end end, 500,0 ) function mapwindowa() deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 elseif (deltaTime >= 4000) and (deltaTime <= 6000) then beta = sy-((1-((deltaTime-4000)/800))*100) else removeEventHandler("onClientRender",getRootElement(),mapwindowa) end dxDrawRectangle((sx-400)/2,beta,400,110,tocolor ( 255, 0, 0, 255 )) dxDrawText("Hidden Cars",125+(sx-400)/2,beta+15,((sx-400)/2)+400,beta+55,tocolor(255,255,255),2,"default-bold","left","top",true) dxDrawText("Disabled",165+(sx-400)/2,beta+60,((sx-400)/2)+400,beta+85,tocolor(255,255,255),1.7,"default","left","top",true) end function mapwindowda() deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 elseif (deltaTime >= 4000) and (deltaTime <= 6000) then beta = sy-((1-((deltaTime-4000)/800))*100) else removeEventHandler("onClientRender",getRootElement(),mapwindowda) end dxDrawRectangle((sx-400)/2,beta,400,110,tocolor ( 0, 255, 0, 255 )) dxDrawText("Hidden Cars",125+(sx-400)/2,beta+15,((sx-400)/2)+400,beta+55,tocolor(255,255,255),2,"default-bold","left","top",true) dxDrawText("Enabled",165+(sx-400)/2,beta+60,((sx-400)/2)+400,beta+85,tocolor(255,255,255),1.7,"default","left","top",true) end Link to comment
DNL291 Posted January 25, 2013 Share Posted January 25, 2013 Speak in english, nobody will understand you. Use the Portuguese forum: https://forum.multitheftauto.com/viewfor ... b77be81978 Link to comment
ZL|LuCaS Posted January 27, 2013 Share Posted January 27, 2013 apague isso em baixo esta o scripts fixed --setElementInterior(vehicle, 999) --setElementInterior(player, 999) -- removeEventHandler("onClientRender",getRootElement(),carclose) -- removeEventHandler("onClientRender",getRootElement(),caropen) --removeEventHandler("onClientRender",getRootElement(),wateropen) --removeEventHandler("onClientRender",getRootElement(),waterclose) local me = getLocalPlayer() local maxStreamedPlayers = 16 sx,sy = guiGetScreenSize() function isDM() for i, pu in pairs (getElementsByType("racepickup")) do local puType = getElementData(pu, "type") if (puType == "vehiclechange") then local puVehicle = tonumber(getElementData(pu, "vehicle")) if puVehicle == 425 then return true end end end return false end enabled = false function toggleHideAll() startTimess = getTickCount() setElementData(me, "hideAllPlayers", not getElementData(me, "hideAllPlayers"), false) if enabled == false then removeEventHandler("onClientRender",getRootElement(),mapwindowa) addEventHandler("onClientRender",getRootElement(),mapwindowda) else removeEventHandler("onClientRender",getRootElement(),mapwindowda) addEventHandler("onClientRender",getRootElement(),mapwindowa) end enabled = not enabled end bindKey("O", "down", toggleHideAll) function getPlayers() return getElementsByType("player") end streamedPlayers = {} function hidePlayer(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then if getElementModel(vehicle) == 425 then showPlayer(player) return end if getElementDimension(vehicle) ~= 999 or getElementDimension(player) ~= 999 or getElementInterior(player) ~= 999 or getElementInterior(vehicle) ~= 999 then setElementDimension(vehicle, 999) setElementDimension(player, 999) --setElementInterior(vehicle, 999) --setElementInterior(player, 999) end end end function showPlayer(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then if getElementDimension(vehicle) ~= 0 or getElementDimension(player) ~= 0 or getElementInterior(player) ~= 0 or getElementInterior(vehicle) ~= 0 then setElementDimension(vehicle, 0) setElementDimension(player, 0) --setElementInterior(vehicle, 0) --setElementInterior(player, 0) end end end setTimer( function() streamedPlayers = {} if getElementData(me, "state") ~= "alive" then for id, player in ipairs(getPlayers()) do if getElementData(player,"state") == "alive" then showPlayer(player) end end else if getElementData(me, "hideAllPlayers") and isDM() then for id, player in ipairs(getPlayers()) do if player ~= me then hidePlayer(player) end end return end local x2,y2,z2 = getElementPosition(me) for id, player in ipairs(getPlayers()) do if player ~= me then local x1,y1,z1 = getElementPosition(player) local d = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2 ) if d < 200 then table.insert(streamedPlayers, {player, d }) end end end if #streamedPlayers > maxStreamedPlayers then table.sort(streamedPlayers, function(a,b) return a[2] < b[2] end) for i = 1, maxStreamedPlayers do showPlayer(streamedPlayers[i][1]) end for i = maxStreamedPlayers+1, #streamedPlayers do hidePlayer(streamedPlayers[i][1]) end else for id, player in ipairs(getPlayers()) do if getElementData(player, "state") == "alive" then showPlayer(player) end end end end end, 500,0 ) function mapwindowa() deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 elseif (deltaTime >= 4000) and (deltaTime <= 6000) then beta = sy-((1-((deltaTime-4000)/800))*100) else removeEventHandler("onClientRender",getRootElement(),mapwindowa) end dxDrawRectangle((sx-400)/2,beta,400,110,tocolor ( 255, 0, 0, 255 )) dxDrawText("Hidden Cars",125+(sx-400)/2,beta+15,((sx-400)/2)+400,beta+55,tocolor(255,255,255),2,"default-bold","left","top",true) dxDrawText("Disabled",165+(sx-400)/2,beta+60,((sx-400)/2)+400,beta+85,tocolor(255,255,255),1.7,"default","left","top",true) end function mapwindowda() deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 elseif (deltaTime >= 4000) and (deltaTime <= 6000) then beta = sy-((1-((deltaTime-4000)/800))*100) else removeEventHandler("onClientRender",getRootElement(),mapwindowda) end dxDrawRectangle((sx-400)/2,beta,400,110,tocolor ( 0, 255, 0, 255 )) dxDrawText("Hidden Cars",125+(sx-400)/2,beta+15,((sx-400)/2)+400,beta+55,tocolor(255,255,255),2,"default-bold","left","top",true) dxDrawText("Enabled",165+(sx-400)/2,beta+60,((sx-400)/2)+400,beta+85,tocolor(255,255,255),1.7,"default","left","top",true) end Link to comment
Speak Posted January 27, 2013 Author Share Posted January 27, 2013 Bugs fixeddddddddddddddd obrigado ZL|LuCaS Link to comment
Snes Posted February 3, 2013 Share Posted February 3, 2013 DNL291 Topico esta na area certa : ___________________________________________________________________________________________________________ Link to comment
DNL291 Posted February 4, 2013 Share Posted February 4, 2013 DNL291 Topico esta na area certa : Agora está na área certa porque foi movido por um moderador. 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