-
Posts
1,028 -
Joined
-
Last visited
-
Days Won
1
Everything posted by ..:D&G:..
-
Try making a separate function with a command and a chatbox: function test(thePlayer) outputChatBox(type(isPlayerRaceDead(thePlayer))) end addCommandHandler("test12", test) And see what it returns.
-
In the same resource, but different .lua file. It worked when I did: function test(thePlayer) outputChatBox(tonumber(getPlayerCoins(thePlayer))) end addCommandHandler("test12", test) But in the function that I posted firstly, didn't work.
-
Are you exporting the function using "exports"? If so, have you added the export name in the resource's meta?
-
Hello guys, I am working on an exchange-system and I want to make a machine that exchanges coins for money. When a player selects the amount of coins they want to exchange, I get an error saying that getPlayerCoins retuns nil, even tho when I made a function with a command and chatbox, it returned my number of coins. function exchangeOption1(thePlayer) local playerCoins = tonumber(getPlayerCoins(thePlayer)) if (playerCoins > 99) then givePlayerMoney(thePlayer, 1) takePlayerCoins(thePlayer, 100) else outputChatBox("You don't have enough coins!", thePlayer, 255, 255, 0) end end addEvent("exchangeOption1", true) addEventHandler("exchangeOption1", getRootElement(), exchangeOption1) Client side - function proceedCEM( button, state ) if ( button == "left" and state == "up" ) then if (guiRadioButtonGetSelected(option1)) then triggerServerEvent("exchangeOption1", getLocalPlayer()) closeCEM() elseif (guiRadioButtonGetSelected(option2)) then triggerServerEvent("exchangeOption2", getLocalPlayer()) closeCEM() elseif (guiRadioButtonGetSelected(option3)) then triggerServerEvent("exchangeOption3", getLocalPlayer()) closeCEM() elseif (guiRadioButtonGetSelected(option4)) then triggerServerEvent("exchangeOption4", getLocalPlayer()) closeCEM() elseif (guiRadioButtonGetSelected(option5)) then triggerServerEvent("exchangeOption5", getLocalPlayer()) closeCEM() elseif (guiRadioButtonGetSelected(option6)) then triggerServerEvent("exchangeOption6", getLocalPlayer()) closeCEM() else showPINCodeError("You did not select an option.") end end end Any ideas guys?
-
Hello guys, I have a Dell Inspiron 530 and I was thinking of upgrading it. My budget is £300 and I wanted to get a new motherboard (DG33M03), a new Power Supply (CORSAIR Builder Series CX500 ATX PSU), a Graphics Card (Nvidia-Geforce-GT-730-Graphics-Card-4-GB) and maybe a new CPU (Yorkfield Quad Core, Q9650, 3.0G, 12MB, 1333 FSB, as it's the best I can get for that motherboard) But the question is, is it really worth it? I am a gamer, playing games like Dying Light, (maybe GTA 5), Far Cry 4, Watch Dogs etc. I really need advice in this, as I don't want to waste my money, when I could of get a better PC. Thank you.
-
I keep getting this error when I try to get the text from a grid list I get this error: Attempt to perform arithmetic on upvalue "bankBalance" (a nil value) if (not wrong) then if (money ~= nil) and (tonumber(amount) <= money) then if (tonumber(amount) > 0) then local bankBalance = guiGridListGetItemText(accountList, selectedRow, 3) bankBalance = "$".. tostring( bankBalance + amount ) Any ideas guys? Thanks.
-
I fixed it by using this code: function drawDiscsNight() guiSetVisible(discnight, true) guiSetVisible(theDiscNight, true) guiSetProperty( theDiscNight, "AlwaysOnTop", "True" ) end function notDrawDiscsNight() guiSetVisible(discnight, false) guiSetVisible(theDiscNight, false) end function drawLights() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if (vehicle) then if ( getVehicleOverrideLights ( vehicle ) == 2 ) then addEventHandler("onClientRender", getRootElement(), drawDiscsNight) removeEventHandler("onClientRender", getRootElement(), notDrawDiscsNight) else if ( getVehicleOverrideLights ( vehicle ) == 1 ) then removeEventHandler("onClientRender", getRootElement(), drawDiscsNight) addEventHandler("onClientRender", getRootElement(), notDrawDiscsNight) end end end end But I keep getting an error saying that the events are already handled in another function, but they ain't (I think...)
-
This is what I've done but it still doesnt' show up. function drawFuelLights() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if (vehicle) then if ( getVehicleOverrideLights ( vehicle ) == 2 ) then theDiscNight = dxDrawImage( discX, discY, imageWidth, imageHeight, "fuelmeter/fueldisc-night.png" ) else if (theDiscNight) then removeEventHandler("onClientRender", getRootElement(), drawFuelLights) end end end end I am soo damn angry cuz I been trying to do this thing for 2 hours now, and can't get it to work! When I used guiCreateStatic image, it worked but created lots of images on top of each other, now, they don't work at all!
-
Hello guys, I made a speedometer that glows when you turn on the lights, but when I turn on the lights, 1000 images open on top of each other. function drawFuelLights() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if (vehicle) then if ( getVehicleOverrideLights ( vehicle ) == 2 ) then if not (thDiscNight) then theDiscNight = guiCreateStaticImage( discX, discY, imageWidth, imageHeight, "fuelmeter/fueldisc-night.png", false ) end else if (theDiscNight) then guiSetVisible(theDiscNight, false) end end end end function onVehicleEnter(thePlayer, seat) if (thePlayer==getLocalPlayer()) then if (seat<2) then if seat == 0 then addEventHandler("onClientRender", getRootElement(), drawFuelLights) end end end end addEventHandler("onClientVehicleEnter", getRootElement(), onVehicleEnter) function onVehicleExit(thePlayer, seat) if (thePlayer==getLocalPlayer()) then if (seat<2) then if seat == 0 then removeEventHandler("onClientRender", getRootElement(), drawFuelLights) end end end end addEventHandler("onClientVehicleExit", getRootElement(), onVehicleExit) Any ideas?
-
getVehicleOverrideLights returns boolean, and when I start the resource I get that error, and the player is not in a vehicle, but it should work when the player gets in a vehicle..
-
Hey, I am trying to make a speedometer and the script returns boolean instead of the vehicle when I try to see if the vehicle has it's lights on. local vehicle = getPedOccupiedVehicle(localPlayer) if ( getVehicleOverrideLights ( vehicle ) == 2 ) then disc = guiCreateStaticImage(screenX - globalImageWidth - globalOffsetX, screenY - globalImageHeight - ( globalOffsetY + 15 ), globalImageWidth, globalImageHeight, "speedometer/disc.png", false) Any ideas how to fix it?
-
It worked, thanks a lot
-
And what if sometimes it is in the format (00.00 Text)?
-
Hello guys, I need a bit of help with reading a number (0.00) before a text (0.00 Text) At the moment my script reads the numbers after a text, like this: (text 0.00) using this code: guiGridListGetItemText(shopItemsList, row, 2):sub(6) Is there a :sub kinda things that does the revers? To read the numbers from right to left? Thank you.
-
It worked Thanks man, I owe you ;D
-
Hello guys, I am making an economy system for my server. I made a coins system which I want to use in shops. For example I want to sell a Burger for $4.50, so I want the player to pay 4 dollars, (takePlayerMoney) and then the number after the decimal (.50) to be takem from the player as 50 coins (takePlayerCoins). I really don't know how to do this , the items from shops are in a table like this: local shops = { -- General [1] = { {"Mask", "A Mask", "$5.25"}, {"Cookies", "A packet of cookies", "$3.53"}, {"Water Bottle", "A bottle of water", "$1.99"}, {"Ice Cream", "A cold Ice Cream", "$3.56"}, {"Coca Cola", "A can of Coca Cola", "$1.10"}, {"Lighter", "A stylish Lighter", "$2.59"}, {"Cigarette", "A Cigarette", "$0.50"}, {"Card Deck", "A Card Deck", "$5.20"} }, } Also, the prices are taken from a row: local itemCost = guiGridListGetItemText(shopItemsList, row, 2):sub(2) Any idea how to do this guys? Thanks.
-
I fixed it, thanks.
-
This script sounds valhalla to me "the export"
-
Doesn't matter, I managed to find it
-
I was thinking of doing so, but I don't know what font the default hud has
-
Hello guys, is there any other way to add another money or another element under the money hud? Thank you.
-
Fixed it, thanks!
-
Hello guys, I opened my test server today and when I joined I couldn't see nothing in the chat box. Also, I noticed that I cannot type in the chatbox, but I can see the messages and also type in the F8 console and that I cannot see 3D Texts, hud nor the radar. Any ideas how to fix this?
-
Hello guys, I opened my test server today and when I joined I couldn't see nothing in the chat box. Also, I noticed that I cannot type in the chatbox, but I can see the messages and also type in the F8 console. Any ideas how to fix this?
-
Well, I guess I won't be using my VPS to host a server