Jump to content

Damien_Teh_Demon

Members
  • Posts

    53
  • Joined

  • Last visited

Everything posted by Damien_Teh_Demon

  1. No, i need it to work sort of like that but random choose the values from that table, here is full code local screenWidth,screenHeight = guiGetScreenSize() GUIEditor = { button = {}, window = {} } possibiltyThings = {2,4,6,8,10,12,14,16,18,20} randomNumbers = {} for k=1, 9 do table.insert(randomNumbers, possibiltyThings[math.random(#possibiltyThings)]) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() GUIEditor.window[1] = guiCreateWindow(207, 166, 224, 167, "SARG:RPG Lottery Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(25, 99, 180, 31, "close", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(31, 33, 164, 34, "Buy Ticket", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(456, 683, 453, 35, "Scratch The Ticket To See If You Win!", false) guiSetVisible(GUIEditor.button[3], false) addEventHandler("onClientGUIClick", GUIEditor.button[3], function() lotteryTickOpen = false lotteryTickScratchedOpen = true exports.SARGcommands:sendClientMessage("*SARG Lottery* Goodluck!", 0, 255, 0) guiSetVisible(GUIEditor.button[3], false) randomNumber1 = possibiltyThings[math.random(#possibiltyThings)] randomNumber2 = possibiltyThings[math.random(#possibiltyThings)] randomNumber3 = possibiltyThings[math.random(#possibiltyThings)] randomNumber4 = possibiltyThings[math.random(#possibiltyThings)] randomNumber5 = possibiltyThings[math.random(#possibiltyThings)] randomNumber6 = possibiltyThings[math.random(#possibiltyThings)] randomNumber7 = possibiltyThings[math.random(#possibiltyThings)] randomNumber8 = possibiltyThings[math.random(#possibiltyThings)] randomNumber9 = possibiltyThings[math.random(#possibiltyThings)] --check for 3 same values: sameValueCount={} for k, v in pairs(possibiltyThings) do sameValueCount[v] = (sameValueCount[v] or 0) + 1 if(sameValueCount[v] == 3)then amountToGive = possibiltyThings[v]*1000 print("test") exports.SARGcommands:giveMoney(v, amountToGive) end end setElementData(localPlayer,"ticketsLeft", getElementData(localPlayer,"ticketsLeft")-1) setTimer(function() showCursor(false) guiSetVisible(GUIEditor.button[3], false) lotteryTickScratchedOpen = false end,5000, 1) end) guiSetVisible(GUIEditor.window[1], false) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function() guiSetVisible(GUIEditor.window[1], false) showCursor(false ) end ) addEventHandler ( "onClientGUIClick", GUIEditor.button[2], function() if(getElementData(localPlayer,"ticketsLeft"))then setElementData(localPlayer,"ticketsLeft", getElementData(localPlayer,"ticketsLeft")+1) exports.SARGcommands:sendClientMessage("*SARG Lottery* You have bought 1 ticket! Do /lotto to see if you won! ( You have a total of "..getElementData(localPlayer,"ticketsLeft").." tickets now!)", 0, 255, 0) else setElementData(localPlayer,"ticketsLeft",1) end end ) lottoStoreMarker = createMarker(2637.25390625,1129.6761474609,11.1796875,"cylinder",3.0,0,255,0,100) addEventHandler("onClientMarkerHit", lottoStoreMarker, function(hitElement) if(hitElement==localPlayer)then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end) end) addCommandHandler("lotto", function() lotteryTickOpen = true guiSetVisible(GUIEditor.button[3], true) showCursor(true) end) addEventHandler("onClientRender", getRootElement(), function() if(lotteryTickOpen and getElementData(localPlayer,"ticketsLeft")>0)then dxDrawImage ( screenWidth/2-224.5,screenHeight/2-300, 449, 600, 'lotteryNotscratched.png') elseif(lotteryTickScratchedOpen and getElementData(localPlayer,"ticketsLeft")>0)then dxDrawImage ( screenWidth/2-224.5,screenHeight/2-300, 449, 600, 'lotteryScratched.png') --lotoslots dxDrawText(tostring(randomNumber1), 467, 290, 584, 402, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber2), 613, 290, 730, 402, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber3), 768, 290, 885, 402, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber4), 467, 432, 584, 544, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber5), 618, 432, 735, 544, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber6), 768, 432, 885, 544, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber7), 471, 562, 588, 674, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber8), 622, 562, 739, 674, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) dxDrawText(tostring(randomNumber9), 768, 562, 885, 674, tocolor(0,0,0, 255), 3.00, "default", "center", "center", false, false, true, false, false) end end) -- SLOT 1,1 ----- dxDrawText("1K", 467, 290, 584, 402, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 1,2 ----- dxDrawText("2K", 613, 290, 730, 402, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 1,3 ----- dxDrawText("3K", 768, 290, 885, 402, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 2,1 ----- dxDrawText("4K", 467, 432, 584, 544, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 2,2 ----- dxDrawText("5K", 618, 432, 735, 544, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 2,3 ----- dxDrawText("6K", 768, 432, 885, 544, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 3,1 ----- dxDrawText("7K", 471, 562, 588, 674, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 3,2 ----- dxDrawText("8K", 622, 562, 739, 674, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false) -- SLOT 3,3 ----- dxDrawText("9K", 768, 562, 885, 674, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false)
  2. Okayi posted it wrong earlier, what about thiss possibiltyThings = {2,4,6,8,10,12,14,16,18,20} sameValueCount={} for k, v in pairs(possibiltyThings) do sameValueCount[v] = (sameValueCount[v] or 0) + 1 if(sameValueCount[v] == 3)then amountToGive = possibiltyThings[v]*1000 print("test") exports.SARGcommands:giveMoney(localPlayer, amountToGive) end end
  3. randomNumber1 = possibiltyThings[math.random(#possibiltyThings)] randomNumber2 = possibiltyThings[math.random(#possibiltyThings)] randomNumber3 = possibiltyThings[math.random(#possibiltyThings)] randomNumber4 = possibiltyThings[math.random(#possibiltyThings)] randomNumber5 = possibiltyThings[math.random(#possibiltyThings)] randomNumber6 = possibiltyThings[math.random(#possibiltyThings)] randomNumber7 = possibiltyThings[math.random(#possibiltyThings)] randomNumber8 = possibiltyThings[math.random(#possibiltyThings)] randomNumber9 = possibiltyThings[math.random(#possibiltyThings)] for k, v in pairs(possibiltyThings) do sameValueCount[v] = (sameValueCount[v] or 0) + 1 if(sameValueCount[v] == 3)then amountToGive = split ( v, "k" ) exports.SARGcommands:giveMoney(localPlayer, tonumber(amountToGive)) end end Why wont this work?
  4. Im trying to check a lua table to see if 3 of the values in the table are the same. The table consists of strings and looks like this possibiltyThings = {"2k","4k","6k","8k","10k","12k","14k","16k", "18k","20k","40k","80k"} Without using tons of if statements.
  5. Oops, my bad, i will be sure to upload it to a new website, that was my homeserver as my mediafire was messed up
  6. Alright, is there a way i coult tint it blue in some way? Or should ijust use a marker or sometin to do that
  7. Would it allow me to make it "Smaller"
  8. Would it be possible to scale a ped? And/or set its color?
  9. how would i go about setting the sprint max speed, and acceleration, along with how high he jumps,
  10. I just added artillery strike, making it better, using some of your script ideas. As of now 90% of server is done me, the HUD and Login are by FG as this is part of thier community as of two days ago. OPEN BETA TESTING TODAY @ 75.183.59.25:16002
  11. Haha, well i need mappers, so yep! I have done ALOT of gui updates. Everything is now dx and animated.
  12. Your kidding right? Alot of britain and alot of germany was bombed. This statement is completely wrong
  13. Will think about it, hopefully somebody else would make the mod because i suck at that stuff
  14. Hey, im releasing something i made today after thinking about a gamemode i use to play on SAMP back in the day, the gamemode is pretty simple. There are a few diffrent groups under two main groups, government and anti government. There is also a president. The objective for anti gov is to kill the president within 10 minutes and the president's is to, well, survive. The gamemode will be released with more and more features but its pretty simple. If you wanna be elgible for becoming president do /president while not being a anti-gov. After a president dies, everyone dies, and round is reset, and new president is chosen from the people who applyed. http://prntscr.com/2s0r8o http://prntscr.com/2s0rb5 The download is to big for the community so i am going to upload it onto my webserver:
  15. Hey i am wondering what are the ways i could remove world objects, all of them, is there a way to get a table of them?
  16. Public release will be very soon ,i need mappers more than anything..
  17. 75.183.59.25:16002 for preview! If anyone wants the gamemode you can pm me and we can work something out, i dont want to release this to EVERYONE, because i dont want it to become a ordinary thing by the offchance it would. PS~ This version is done
  18. http://prntscr.com/2roxba Thought it looked cool
  19. I thought i removed the local's my bad, plus he already knew that he cant have local tables, sorry doe
×
×
  • Create New...