-
Posts
1,028 -
Joined
-
Last visited
-
Days Won
1
Everything posted by ..:D&G:..
-
Hey, I am using some triggers to "setGuiText", but it looks like it updates the same text for all players with that window open. How can I make it so it only updates for the player that triggered the event? Server side: triggerClientEvent ( getRootElement(), "showConversionResult", resourceRoot, from, to, tonumber ( amount ), results["rates"][to] ) client: function showConversionResult ( from, to, amount, result ) result = result * amount result = math.floor ( result + 0.5 ) guiSetText(currencyConversionResult, result) end addEvent ( "showConversionResult", true ) addEventHandler ( "showConversionResult", root, showConversionResult )
-
Hello peeps, is there a way of getting a text using guiGetText and check if it's a normal whole number? I want to output an error if the player enters a number with , or ., or a number and a letter, I want to check if the number the player entered in a memo is a whole number. Thanks.
-
Ikr I've been smashing my head on this script since 10am
-
Fixed! It was because I made it to be a "tonumber" instead of "tostring"
-
In the picture, you tried without spaces so try without spaces. What spaces? I see that he used the spaces between the text and - ...
-
It looks like it outputs nil here: local currencyInitialsTo = tonumber ( splittedNameTo [ 2 ] ) But I don't know why
-
Try now function setDeathSpawn() guiSetVisible(SPAWN.window[1],true) showCursor(true) end addEventHandler("onClientPlayerWasted",getLocalPlayer(),setDeathSpawn)
-
Hello guys, I am trying to make a currency exchange window. You select the currency from a combobox, which is like this: "Dollars - USD" and I use this to split the "Dollars" (name) from the "USD" (initial): local listFrom = guiComboBoxGetSelected(currencyListFrom) local textFrom = guiComboBoxGetItemText(currencyListFrom, listFrom) local splittedNameFrom = split ( tostring ( textFrom ), " - " ) local currencyNameFrom = tostring ( splittedNameFrom [ 1 ] ) local currencyInitialsFrom = tonumber ( splittedNameFrom [ 2 ] ) The problem is that if I try to output "currencyInitialsFrom" into outputChatBox it gets nil, any ideas why? Thanks.
-
May I ask why you did "result = result * amount"? Just curious
-
The thing is that I want to set the default currency from a window, so I want to make a command to set it.
-
You added the function in the fetchRemote and I don't get how that works... Also, I did this to change the currency but it doesn't seem to work, it gives me invalid currency after I try to convert something ---EDIT It shows me that the currency is invalid only when I try to convert the same currency... But it work. Any idea how to get the currency that I've set so I can change where it says "EUR =="? function updateCurrencies ( currency ) fetchRemote ( "http://api.fixer.io/latest?base="..currency, function ( response, error ) if error == 0 then local decode = fromJSON ( response ) currencies = decode["rates"] else print ( "error "..error.." when getting the currency." ) end end ) return true end --updateCurrencies() setTimer ( updateCurrencies, 1 * 3600000, 0 ) function updateCurrencyLink(thePlayer, cmd, currency) updateCurrencies(currency) outputChatBox(currency, thePlayer) end addCommandHandler("setcurrency", updateCurrencyLink)
-
The "updateCurrencies" function I didn't understand, but how do I convert USDs to Pounds for example? That function converts Euros to other thing. I see that the default currency is Euro, but how do I convert something different than Euros?
-
I totally agree with you here. Most players want to see owl scripts or scripts that other servers have, because they are just not used to other scripts...
-
you don't need to create a website... fetchRemote ( "http://api.fixer.io/latest", function ( response, error ) if error == 0 then response = fromJSON ( response ) -- the response is encoded in json, then we need to use fromJSON print ( "1 EUR == "..response["rates"]["BRL"].." BRL" ) else print ( "error "..error.." when getting the currency." ) end end ) And how do I use that? I never used a fetchRemote function before... Like, how do I make a command like "/checkexchange 1 eur" ?
-
You don't get it I managed to make it work, but me and my friend have different resolutions, and he sees it in a different way than me... I added you on skype btw
-
Those are API's and I have to make a website for that, which I don't really want to atm, I want something simple I found this https://www.google.com/finance/converter , But I don't know how to call it so I can select the currencies and amount in-game, and also display only the result of the conversion..
-
Um... I just bumped into an issue again... On my screen (1024x768) I see it perfect, like this: And my friend, with a resolution of 1440x900 sees it like this: local x, y = guiGetScreenSize() local rx, ry = (x/1024), (y/768) dxDrawRectangle(rx*883, ry*285, rx*141, ry*121, tocolor(0, 0, 0, 150), false) dxDrawImage(rx*886, rx*329, rx*30, rx*34, "images/dollar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(playerEurosValue, rx*922 - 1, rx*300 - 1, rx*1007 - 1, rx*318 - 1, tocolor(0, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false) Any ideas?
-
Hey guys, I am trying to make a window that is showing the real life currency exchange rates. Something like "£1 -> $1.56" the thing is I don't know how to get the real life currency and how to make it that simple, because google's currency thing gives me a longer number...
-
Oh, I get it now. I only have to add "rx*" to the size and possition of the dx on my resolution Didn't know it was that easy, thanks a lot ! But I got another problem. The dx elements only render when I use "onClientRender". I used to use "onClientResourceStart" but the dx appears for only 1 seconds and disappears... Any ideas? EDIT--- Fixed!
-
I did this: function centerWindow(window_element) local windowW,windowH = guiGetSize(window_element,false) local x, y = (screenW-windowW)/2, (screenH-windowH)/2 guiSetPosition(window_element, x+440, y, false) end With the size of the gui element beeing this: 141, 121 the x+440 made the guy element perfect on the middle right side of the screen, but my friend with a higher resolution still seens the gui element more to the left, away from the right side of the screen.. ----------------------- The problem is I don't use DX. I have too many small elements that I can't take my time with, so I make them a child of the bigger element (window image)...
-
Hello guys, I am trying to make a small image in the middle right part of the screen, but I keep bumping on an issue. The image is fine for me, but for a friend with a bigger resolution, he gets it more to the left and a bit longer to the right Any ideas? local x, y = guiGetScreenSize() currencyWindow = guiCreateStaticImage(x/2 + 370, y/2, x/7.2, y/7, ":guieditor/images/examples/fereastra.png", false)
-
Hello guys, I am making a scoreboard and I would like to add the player's FPS to it, but I can't find any function to get a certain player's FPS... So, is there any way I can do that? Thanks.
-
lol :3 working fine for me , post full code here. local bunuri = { {"Infernus", 5, "images/vehicles/infernus.png"}, {"Bullet", 5, "images/vehicles/bullet.png"}, {"Turismo", 5, "images/vehicles/turismo.png"}, {"Super GT", 4, "images/vehicles/supergt.png"}, {"Banshee", 4, "images/vehicles/banshee.png"}, {"Cheetah", 4, "images/vehicles/cheetah.png"}, {"Hotring Racer", 3, "images/vehicles/hotring.png"}, {"Hotring Racer 2", 3, "images/vehicles/hotrina.png"}, {"Hotring Racer 3", 3, "images/vehicles/hotrinb.png"}, } function showMainBunuriWindow() if isElement(donBunuriMain) then destroyElement(donBunuriMain) showCursor(false) else local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 548, 491 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 donBunuriMain = guiCreateWindow(left, top, windowWidth, windowHeight, "Informatii Bunuri", false) guiWindowSetSizable(donBunuriMain, false) donBunuriList = guiCreateGridList(24, 98, 257, 351, false, donBunuriMain) donBunuriName = guiGridListAddColumn(donBunuriList, "Nume", 0.6) donBunuriPret = guiGridListAddColumn(donBunuriList, "Preţ(Eur)", 0.3) addEventHandler ( "onClientGUIClick", donBunuriList, selectedImage,false ) for i, v in ipairs(bunuri) do local row = guiGridListAddRow(donBunuriList) guiGridListSetItemText(donBunuriList, row, donBunuriName, v[1], false, false) guiGridListSetItemText(donBunuriList, row, donBunuriPret, v[2]..".00 €", false, false) end donInfoTop = guiCreateLabel(60, 39, 440, 18, "Aici puteti vedea bunurile ce le puteti primii pentru suma ce doriti sa o donati!", false, donBunuriMain) guiSetFont(donInfoTop, "default-bold-small") guiLabelSetColor(donInfoTop, 39, 250, 4) donBunuriPic = guiCreateStaticImage(291, 144, 219, 206, "images/default.png", false, donBunuriMain) donInchideButton = guiCreateButton(441, 438, 85, 39, "Închide", false, donBunuriMain) addEventHandler ( "onClientGUIClick", donInchideButton, closeBunuriWindow ) showCursor(true) end end function selectedImage() local row = guiGridListGetSelectedItem(donBunuriList) local currentImage = tostring(guiGridListGetItemText(donBunuriList,row,1)) if(currentImage == "") or (currentImage == " ") then guiStaticImageLoadImage(donBunuriPic,"images/default.png") else if(fileExists("images/"..string.lower(currentImage)..".png")) then guiStaticImageLoadImage(donBunuriPic,"images/"..string.lower(currentImage)..".png") else guiStaticImageLoadImage(donBunuriPic,"images/default.png") end end end
-
If you can't help, just DON'T FUCKING COMMENT! And can you use google and lets see if you find another toy than that scorpion
-
Hello, does anyone know any toys objects skins? I found a scorpion toy, but nothing else. It doesn't matter if it's a weapon, but it has to be small and... a toy... Thanks.
