Jump to content

Gallardo9944

Members
  • Posts

    442
  • Joined

  • Last visited

Everything posted by Gallardo9944

  1. @Bonsai, default environment is always empty and has no default functions. Try changing your env table to "local env = { outputChatBox = outputChatBox }" and run a script which has ONLY outputChatBox in it. It will work.
  2. add something like {{{{{{{{{{{{{{{{}}}}}}{{{{{{{{{}}{}{}}}}}}}}}}}}}}}}}} at the beginning. Decompilers don't like those.
  3. Untested. Don't forget to put your y,z,rx,ry,rz values though. local vehiclesToCreate = 10 local x = 1 local increment = 1 local vehicles = { } for i=1,vehiclesToCreate do local veh = createVehicle (544,x,y,z,rx,ry,rz) table.insert(vehicles,veh) x = x + increment end outputChatBox(#vehicles.." created!",root,0,255,0)
  4. local table1 = { {-1434, 2668, 55.68 }, {-1460, 2669, 55.66 }, } local table2 = { } for i,v in ipairs(table1) do local object = createObject(929,unpack(v)) -- create object with your info table.insert(table2,object) end function onStart() setTimer(doDestroyObjects,5000,1) -- set timer when the resource starts end addEventandler("onResourceStart",resourceRoot,onStart) function doDestroyObjects() for i,v in ipairs(table2) do if isElement(v) then destroyElement(v) end table2[i] = nil end end
  5. local table1 = { {-1434, 2668, 55.68 }, {-1460, 2669, 55.66 }, } local table2 = { } for i,v in ipairs (table1) do local object = createObject(929,unpack(v)) -- create object with your info table.insert(table2,object) end function getObjectFromTable(num) return table2[num] --get the object created from the table end local object1 = getObjectFromTable(1) -- {-1434, 2668, 55.68 } local object2 = getObjectFromTable(2) -- {-1460, 2669, 55.66 }
  6. Gallardo9944

    Twitter

    So, I've to do it with php then, right? You can use your custom PHP page to get everything and transform into JSON, and then send to the server. Furthermore, you can use default Twitter JSON API.
  7. @Anubhav, your code is going to have issues. It will spawn the player each time any resource starts.
  8. local police = getTeamFromName("Police") local players = getPlayersInTeam(police) for i,v in ipairs(players) do outputChatBox("There is a jailbreak respond fast!",v,255,255,255,true) end
  9. Should be working, but it's untested. local x,y = guiGetScreenSize() local topSize = 144 function renderRectangle() local range = isMouseWithinRangeOf(0,x,0,topSize) -- startX,sizeX,startY,sizeY if range then -- if the mouse is in the area dxDrawRectangle(0,0,x,topSize,tocolor(0,0,0,200)) -- 200 alpha if you hover it else dxDrawRectangle(0,0,x,topSize,tocolor(0,0,0,40)) -- 40 otherwise end end addEventHandler("onClientRender",getRootElement(),renderRectangle) function isMouseWithinRangeOf(psx,pssx,psy,pssy) if not isCursorShowing() then return false end local cx,cy = getCursorPosition() cx,cy = cx*x,cy*y if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then return true,cx,cy else return false end end
  10. I haven't misunderstood you. It's not "my shader". You have to set the shader to world objects, excluding the ones you want. Screen source shader will shaderize the screen, not the elements.
  11. dxSetShaderValue( blackWhite, "screenSource", screenSource ) This already means you're setting this to the player screen. You're shadering the screen texture, not the vehicles or anything, so trying to remove it from an object won't work cause it's not applied to any object. You should apply it to all the textures, except vehicle ones. That would be pain in the rear end though.
  12. onClientCharacter would help. But backspace has to be parsed manually.
  13. Unfortunately, the way of copying _G causes problems for some scripts. I'd stick to metatables with index.
  14. you can use setElementDimension clientside instead. For the object you want to hide, of course.
  15. that is suitable though. You can test it on my server, just moved it to this structure.
  16. Confirmed, it works. I had a problem of moving functions into the new env table: -- DOESN'T WORK for i,v in ipairs(_G) do if not (v == "cacheFiles" or v == "loadData" or v == "unloadAll") then --table.insert(RUNCODE,v) -- Neither this RUNCODE[#RUNCODE+1] = v -- Nor that end end -- WORKS setmetatable(RUNCODE,{__index = _G})
  17. Well, in this case, the 'elseif' statemenet might be remade to a usual 'else'.
  18. Yep, i had the same issue with setfenv. I suppose debug.setfenv should be used. But no use though.
  19. Might help though. function transformaNumar( theNumber ) local numaruldefacut = theNumber while true do if not (numaruldefacut == tostring(numaruldefacut)) then -- If it's not the string right now break -- Stop it end numaruldefacut , p = string.gsub(numaruldefacut , "^(-?%d+)(%d%d%d)", "%1,%2") if (p==0) then break end end return numaruldefacut end
  20. I use _EVN changes and that seems to work though. The only thing I have to do is to move _G stuff into the environment table. Seems to help. Then just empty the environment and it should be fine. At least that's how it works at my server.
×
×
  • Create New...