-
Posts
1,273 -
Joined
-
Last visited
-
Days Won
1
Everything posted by GTX
-
Do you mean when second player dies, it outputs him message?
-
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)
-
--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 )
-
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)
-
showCursor To inject to browser: addEventHandler("onClientClick", root, function(button, state) if state == "down" then injectBrowserMouseDown(browser, button) else injectBrowserMouseUp(browser, button) end end )
-
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
-
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 )
-
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)
-
What do you mean? To 'set' dxDrawImage as GUI's parent?
-
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)
-
You can do it with createBrowser function.
-
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)
-
There's small workaround. Cut a bit of top and bottom edge. (Probably use dxDrawImageSection)
-
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.
-
This? engineSetModelLODDistance
-
Is this the whole code? If so; function spawnskins(mid) setElementModel(source,tonumber(mid)) end addEvent("spawnskin",true) addEventHandler("spawnskin",root,spawnskins)
-
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.
-
Put this under ACL "Admin": <right name="resource.hedit.access" access="true"></right>
-
This is not a request forum. viewtopic.php?f=91&t=47897
-
I think it should work if you add this under ACL "Everyone": <right name="resource.hedit.access" access="false"></right>
-
Save them either in MySQL, account data, XML or SQLite.
-
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 )