Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. Do you mean when second player dies, it outputs him message?
  2. If you use when player quits, if server crashes, data won't be saved. If you use when data changes, it may affect server performance (Not much but I recommend this method if you're unsure whether server will crash or not)
  3. GTX

    HTML full screen

    --In order to render the browser on the full screen, we need to know the dimensions. local screenWidth, screenHeight = guiGetScreenSize() --Let's create a new browser in local mode. We will not be able to load an external URL. local webBrowser = createBrowser(screenWidth, screenHeight, true, false) --This is the function to render the browser. function webBrowserRender() --Render the browser on the full size of the screen. dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end --The event onClientBrowserCreated will be triggered, after the browser has been initialized. --After this event has been triggered, we will be able to load our URL and start drawing. addEventHandler("onClientBrowserCreated", webBrowser, function() --After the browser has been initialized, we can load our file. loadBrowserURL(webBrowser, "login/index.html") --Now we can start to render the browser. addEventHandler("onClientRender", root, webBrowserRender) showCursor(true) addEventHandler("onClientClick", root, function(button, state) if state == "down" then injectBrowserMouseDown(webBrowser, button) else injectBrowserMouseUp(webBrowser, button) end end ) end )
  4. local client = getLocalPlayer() local rootElement = getRootElement() --GUI: local yourX = 1366 local yourY = 768 local sx, sy = guiGetScreenSize() local x, y = sx/yourX, sy/yourY window = guiCreateWindow(493*x,227*y,366*x,294*y,"Bus stations",false) spawn = guiCreateButton(10*x,261*y,146*x,24*y,"Spawn",false,window) reject = guiCreateButton(209*x,261*y,146*x,23*y,"Cancel",false,window) grid = guiCreateGridList(9*x,21*y,348*x,236*y,false,window) guiGridListSetSelectionMode(grid,0) guiGridListAddColumn(grid,"Name:",0.38,window) guiGridListAddColumn(grid,"Location:",0.38,window) guiGridListAddColumn(grid,"Price",0.19,window) guiWindowSetSizable(window,false) guiSetVisible (window,false) Buslocations = { {"Las Venturas Airport","LV",100,1730.42,1480.3,10.81}, ------- Edit [ X, y, z ] to Las Venturas position {"The Emerald Isle","LS",100,2220.22,2477.71,10.82},------- Edit [ X, y, z ] to Los Santo position {"Old Venturas Strip","SF",100,2447.32,2059.2,10.82} ------- Edit [ X, y, z ] to San Fierro position } function locations() for k,v in ipairs (Buslocations) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1,v[1], false, false) guiGridListSetItemText(grid, row, 2,v[2], false, false) guiGridListSetItemText(grid, row, 3,v[3].."$", false, false) guiGridListSetItemText(grid, row, 4,v[4], false, false) guiGridListSetItemText(grid, row, 5,v[5], false, false) guiGridListSetItemText(grid, row, 6,v[6], false, false) end end addEvent("bus:showGUI",true) addEventHandler("bus:showGUI",root, function (Buslocations) guiGridListClear(grid) locations() guiSetVisible (window,true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) elseif (source == spawn) then guiSetVisible(window,false) showCursor(false) local cityname = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 1) local price = Buslocations[guiGridListGetSelectedItem (grid)][3] local x = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 4) local y = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 5) local z = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 6) triggerServerEvent("warpplayer",localPlayer, cityname,price,x,y,z) end end)
  5. GTX

    HTML full screen

    showCursor To inject to browser: addEventHandler("onClientClick", root, function(button, state) if state == "down" then injectBrowserMouseDown(browser, button) else injectBrowserMouseUp(browser, button) end end )
  6. dxDrawImage's last argument is postGUI. If you set it to true, it should cover all GUI's. If you set it to false, the image should move to background (That is, behind GUI). An example: dxDrawImage(10, 0, 120, 140, "blah.png", 0, 0, 0, tocolor(255, 255, 255), false) -- This should move it behind GUIs
  7. GTX

    Gang Letters

    If you type in Portuguese, why don't you take this into Portuguese language forum? Anyways; addCommandHandler( "gangtag", function ( source, cmdname, tag ) if tag and tag:len() < 3 then return outputChatBox("A tag deve ter no máximo 3 caracteres.", source, 230, 0, 0) end if getPlayerTeam(source) and tag then setPlayerName(source, "["..tag.."]"..getPlayerName(source)) elseif not tag then outputChatBox("Sintaxe: /gangtag ", source, 230, 0, 0) end end )
  8. You can't trigger a variable via setTimer wtf? local markers = { {x=1730.42, y=1480.3, z=9.81, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, --Spawn1 {x=2220.22, y=2477.71, z=9.82, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, --Spawn2 {x=2447.32, y=2059.2, z=9.82, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, --spawn3 -- {x=1633.95, y=1831.68, z=9.82, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, } addEventHandler("onResourceStart",resourceRoot, function () for index, pos in pairs(markers) do local marker = createMarker(pos.x, pos.y, pos.z, "cylinder", pos.size, pos.r, pos.g, pos.b, pos.a) setElementInterior (marker, pos.int) setElementDimension(marker, pos.dim) addEventHandler("onMarkerHit",marker,MarkerHit) end end) function MarkerHit(player, dim) if (dim and getElementType(player) == "player") then triggerClientEvent(player,"bus:showGUI",player,Buslocations) end end addEvent ("warpplayer",true) addEventHandler ("warpplayer",getRootElement(), function (cityname,price,x,y,z) if getElementZoneName (source) == cityname then if ( getPlayerMoney ( source ) < 100 ) then outputChatBox("You need 100$ to Travel.", source, 255,0,0) else takePlayerMoney (source,500) setTimer(spawnPlayer,4000,1,source, x, y, z) fadeCamera ( source, false, 1.0, 0, 0, 0 ) end end end)
  9. What do you mean? To 'set' dxDrawImage as GUI's parent?
  10. Try this: local time = getRealTime() months = { [1] = "January", [2] = "February", [3] = "March", [4] = "April", [5] = "May", [6] = "June", [7] = "July", [8] = "August", [9] = "September", [10] = "October", [11] = "November", [12] = "December" } local nonth = months[time.month+1] dxDrawText(nonth..": This Month",0,140,screenWidth,screenHeight*scale,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true)
  11. GTX

    HTML full screen

    You can do it with createBrowser function.
  12. There you go. local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function webBrowserRender() dxDrawImageSection(0, 0, screenWidth, screenHeight, 50, 50, screenWidth-100, screenHeight-100, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "https://www.youtube.com/embed/IhchfhxvPKI?rel=0&autoplay=1&loop=1&playlist=IhchfhxvPKI") addEventHandler("onClientRender", root, webBrowserRender) end)
  13. There's small workaround. Cut a bit of top and bottom edge. (Probably use dxDrawImageSection)
  14. GTX

    HELP | Shaders

    You need to know ID of an object. engineSetModelLODDistance(YOUR_ID, 300) If that function doesn't work, then I'm afraid there's no solution to your problem.
  15. GTX

    HELP | Shaders

    This? engineSetModelLODDistance
  16. GTX

    [HELP] Skin

    Is this the whole code? If so; function spawnskins(mid) setElementModel(source,tonumber(mid)) end addEvent("spawnskin",true) addEventHandler("spawnskin",root,spawnskins)
  17. Maybe remove the line I gave you, which is under "Everyone" and let that one for "Admin" stay. If that doesn't work, remove "user.*" line under ACL "Everyone". I think that should work.
  18. GTX

    Help

    When you enter inside interior, you set interior and dimension like this to move the object along with you. setElementInterior(hitMarker2, getElementInterior(localPlayer)) setElementDimension(hitMarker2, getElementDimension(localPlayer))
  19. Put this under ACL "Admin": <right name="resource.hedit.access" access="true"></right>
  20. This is not a request forum. viewtopic.php?f=91&t=47897
  21. I think it should work if you add this under ACL "Everyone": <right name="resource.hedit.access" access="false"></right>
  22. Save them either in MySQL, account data, XML or SQLite.
  23. GTX

    Help

    setElementInterior setElementDimension
  24. GTX

    Help

    What? This? setElementDoubleSided
  25. Based on zone name: local blacklistCommands = { ["say"] = true } addEventHandler("onPlayerCommand", function(command) local x, y, z = getElementPosition(source) if getZoneName(x, y, z, true) == "Los Santos" and blacklistCommands[command] then cancelEvent() end end ) Or ColShape: local blacklistCommands = { ["say"] = true } local col = createColCircle(...) addEventHandler("onPlayerCommand", function(command) if isElementWithinColShape(source, col) and blacklistCommands[command] then cancelEvent() end end )
×
×
  • Create New...