Jump to content

CsaliHUN

Members
  • Posts

    11
  • Joined

  • Last visited

Details

  • Location
    Hungary
  • Interests
    Scripting

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

CsaliHUN's Achievements

Square

Square (6/54)

0

Reputation

  1. thx a lot, now it works beautiful
  2. Hi Everyone! Can someone help me, how can I make that, if a fire is created it outputs the chatbox the fire's position (example: "The LSPD is on fire" or "The Hospital is on fire" . The Script Files: FireC.lua local fireElement = {} addEvent("FireServer.rootFireCreate",true) addEventHandler("FireServer.rootFireCreate",getRootElement(),function(rand) local fire = createFire(FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3], FirePositions[rand][4], FirePositions[rand][5], FirePositions[rand][6]) fireElement[#fireElement + 1] = fire end) addEventHandler ("onClientResourceStart", getRootElement(), function (res) if res ~= getThisResource() then return end triggerServerEvent("FireServer.loadMe", localPlayer, localPlayer) end) function draw() for k,v in ipairs(getElementsByType("object")) do if getElementData(v, "Fire->object") then local x, y ,z = getElementPosition(v) local wx, wy, wz = getScreenFromWorldPosition(x , y, z+1) if wx and wy then local playerx, playery, playerz = getElementPosition(getLocalPlayer()) if getDistanceBetweenPoints3D(playerx, playery, playerz, wx, wy, wz) <= 5 then dxDrawRectangle(wx-200/2,wy,200,30,tocolor(0,0,0,255/2)) dxDrawRectangle(wx-200/2+5,wy+5,190,20,tocolor(124, 197, 118,255/2)) end end end end end addEventHandler("onClientRender", root, draw) FireG.lua FirePositions = { -- X, Y, Z, Range(FireSize) [1] = {2114.1240234375, -1756.2508544922, 13.3984375, 800}, } FireS.lua local loadedPlayers = {} local fireBar = {} FireServer = {} function FireServer.start(player) loadedPlayers[#loadedPlayers + 1] = player end addEvent("FireServer.loadMe", true) addEventHandler("FireServer.loadMe", root, FireServer.start) function FireServer.FireCreate() if math.random(1, 3) == 2 then local rand = math.random(#FirePositions) if fireBar[rand] then return end for k,v in pairs(loadedPlayers) do triggerClientEvent(v, "FireServer.rootFireCreate", v, rand) fireBar[rand] = createObject(1337, FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3] - 1) setElementAlpha(fireBar[rand], 0) setElementCollisionsEnabled(fireBar[rand], false) setElementData(fireBar[rand], "Fire->object", true) end end end setTimer(FireServer.FireCreate, 1000, 0)
  3. thanks a lot! Now it works beautiful!
  4. it only appears when i still holding the cursor on the object
  5. okay, it didn't worked for me, so I started over Like this, but it only opens up when the cursor is on the object. function openthegui ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if (guiGetVisible(GUIEditor.window[1])) then -- if the window is visible closeWindow() --close else guiSetVisible(GUIEditor.window[1], true) --else show the window setElementData(localPlayer,"2048_active",true,true) showCursor(true) end end addEventHandler ( "onClientClick", getRootElement(), openthegui )
  6. Like this? function openthegui ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if getElementType ( clickedElement ) == "object" and getElementModel ( clickedElement ) == 2778 then if showing then removeEventHandler("onClientRender", getRootElement(), renderFunc) game:destroy() window:destroy() showCursor(false) showing = false else window = DXWindow(sx/2-(319+10)/2, sy/2-(421+30)/2,319+10, 421+30, " ", tocolor(255, 136, 0, 150)) window:setMoveable(true) showCursor(true) game = Game(window.x + 5,window.y + 25, highscore) game:setParent(window) addEventHandler("onClientRender", getRootElement(), renderFunc) showing = true end addEventHandler ( "onClientClick", getRootElement(), openthegui )
  7. Currently I made this, but it doesn't works function openthegui if getElementType ( clickedElement ) == "object" and getElementModel ( clickedElement ) == 2778 then if showing then removeEventHandler("onClientRender", getRootElement(), renderFunc) game:destroy() window:destroy() showCursor(false) showing = false else window = DXWindow(sx/2-(319+10)/2, sy/2-(421+30)/2,319+10, 421+30, " ", tocolor(255, 136, 0, 150)) window:setMoveable(true) showCursor(true) game = Game(window.x + 5,window.y + 25, highscore) game:setParent(window) addEventHandler("onClientRender", getRootElement(), renderFunc) showing = true end addEventHandler ( "onClientClick", getRootElement(), openthegui )
  8. function openthegui if getElementType ( targetElem ) == "object" and getElementModel ( targetElem ) == 2778 then if showing then removeEventHandler("onClientRender", getRootElement(), renderFunc) game:destroy() window:destroy() showCursor(false) showing = false else window = DXWindow(sx/2-(319+10)/2, sy/2-(421+30)/2,319+10, 421+30, "Dream Life - Arcade - 2048", tocolor(255, 136, 0, 150)) window:setMoveable(true) showCursor(true) game = Game(window.x + 5,window.y + 25, highscore) game:setParent(window) addEventHandler("onClientRender", getRootElement(), renderFunc) showing = true end addEventHandler ( "onClientClick", getRootElement(), openthegui ) Is this good? Sry for bad english
  9. Hi everyone! Can someone help me that, if I click on specified object, then run a function named "startit1"
  10. local screenWidth, screenHeight = guiGetScreenSize() GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function showgui() if (vehicle) then GUIEditor.button[1] = guiCreateButton(981, 627, 39, 40, "1", false) guiSetAlpha(GUIEditor.button[1], 0.00) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[2] = guiCreateButton(1025, 627, 39, 40, "2", false) guiSetAlpha(GUIEditor.button[2], 0.00) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFFFF") GUIEditor.button[3] = guiCreateButton(981, 673, 39, 40, "4", false) guiSetAlpha(GUIEditor.button[3], 0.00) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFFFFFF") GUIEditor.button[4] = guiCreateButton(1025, 673, 39, 40, "5", false) guiSetAlpha(GUIEditor.button[4], 0.00) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFFFFFF") GUIEditor.button[5] = guiCreateButton(1069, 673, 39, 40, "6", false) guiSetAlpha(GUIEditor.button[5], 0.00) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFFFFFFF") GUIEditor.button[6] = guiCreateButton(1069, 719, 39, 40, "9", false) guiSetAlpha(GUIEditor.button[6], 0.00) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFFFFFF") GUIEditor.button[7] = guiCreateButton(1025, 719, 39, 40, "8", false) guiSetAlpha(GUIEditor.button[7], 0.00) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFFFFFF") GUIEditor.button[8] = guiCreateButton(981, 719, 39, 40, "7", false) guiSetAlpha(GUIEditor.button[8], 0.00) guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFFFFFFF") GUIEditor.button[9] = guiCreateButton(1025, 765, 39, 40, "0", false) guiSetAlpha(GUIEditor.button[9], 0.00) guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFFFFFFF") GUIEditor.button[10] = guiCreateButton(892, 573, 39, 40, "CLEAR", false) guiSetAlpha(GUIEditor.button[10], 0.00) guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFF70000") GUIEditor.button[11] = guiCreateButton(892, 627, 39, 40, "DEMO", false) guiSetAlpha(GUIEditor.button[11], 0.00) guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FF66F92C") GUIEditor.button[12] = guiCreateButton(892, 673, 39, 40, "AM", false) guiSetAlpha(GUIEditor.button[12], 0.00) guiSetProperty(GUIEditor.button[12], "NormalTextColour", "FFE7E53D") GUIEditor.button[13] = guiCreateButton(892, 719, 39, 40, "PM", false) guiSetAlpha(GUIEditor.button[13], 0.00) guiSetProperty(GUIEditor.button[13], "NormalTextColour", "FF8D9096") GUIEditor.button[14] = guiCreateButton(892, 765, 39, 40, "ENTER", false) guiSetAlpha(GUIEditor.button[14], 0.00) guiSetProperty(GUIEditor.button[14], "NormalTextColour", "FF3F4145") GUIEditor.button[15] = guiCreateButton(981, 765, 39, 40, "-", false) guiSetAlpha(GUIEditor.button[15], 0.27) guiSetProperty(GUIEditor.button[15], "NormalTextColour", "FFFFFFFF") GUIEditor.button[16] = guiCreateButton(1069, 627, 39, 40, "3", false) guiSetAlpha(GUIEditor.button[16], 0.00) guiSetProperty(GUIEditor.button[16], "NormalTextColour", "FFFFFFFF") GUIEditor.edit[1] = guiCreateEdit(951, 575, 192, 32, "MM-DD-YYYY-HH-MM-AMPM", false) guiSetProperty(GUIEditor.edit[1], "NormalTextColour", "FF000100") guiEditSetMaxLength ( GUIEditor.edit[1], 21 ) end ) local dxfont0_BTTF = dxCreateFont("fonts/BTTF.ttf", 10) addEventHandler("onClientRender", root, function showgui() if (vehicle) then dxDrawImage(444, 559, 433, 269, "images/time_circuits.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("By: CsaliHUN", 745 - 1, 810 - 1, 873 - 1, 828 - 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745 + 1, 810 - 1, 873 + 1, 828 - 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745 - 1, 810 + 1, 873 - 1, 828 + 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745 + 1, 810 + 1, 873 + 1, 828 + 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745, 810, 873, 828, tocolor(246, 92, 8, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawImage(878, 557, 275, 271, "images/buttons.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("", 951, 575, 1143, 607, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end ) addEventHandler ( "onClientGUIClick", GUIEditor.button[16], outputEditBox, false ) function outputEditBox ( button ) if button == "left" then local text = guiGetText ( GUIEditor.edit[1] ) outputChatBox("Uticél beállítva:",player,255,69,0) outputChatBox (( text ),player,255,69,0) outputChatBox("Érd el a 88 km/h sebességet az utazáshoz!",player,255,69,0) end end addEventHandler("onClientRender", root, showgui) addCommandHandler ( "bttf", showgui ) function HandleTheRendering ( ) addEventHandler("onClientRender", root, renderDisplay) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) SORRY FOR BAD ENGLISH Please help me, I made a GUI, that needs to show on when I enter a Tampa , but it didn't show on. And also can someone help me to make that if i click on a button it will write something to an edit box, then if i click on an other button it will send it to local chat. ((The buttons alpha = 0 because there's a picture behind them))
×
×
  • Create New...