Booms

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Booms

  • Rank
    I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.
  1. local hatarped = createPed ( 71, 69.71004, -1532.15381, 5.13079); setElementData(hatarped, "katt", "hatar"); local hatarkapu = createObject(2909, 68.10683, -1526.46423, 4.85258); local kor = {createColSphere( 68.53889, -1526.16394, 4.84955, 12.5 )}; addEvent("sikeres", true); addEventHandler("sikeres", root, function(osszeg, localPlayer) if (localPlayer) then local pMoney = getPlayerMoney(localPlayer); if (pMoney >= osszeg) then setPlayerMoney(localPlayer, pMoney-osszeg); moveObject(hatarkapu, 1000, 68.10683, -1526.46423, 2.5); local asd = 1; mit = setTimer( function() asd = asd + 1; local isInSpot = getElementsWithinColShape(kor[1], "player"); if not (#isInSpot > 0) or (asd > 12) then moveObject(hatarkapu, 1000, 68.10683, -1526.46423, 4.85258); if (mit) then killTimer(mit); end end end ,1000,0) end end end ); The problem is: It watchs all of the player,who are staying in the colshape. I want to watch the localPlayer,who paid the terminal.
  2. The problem with it : It writes the outputChatBox as many times as I enter to the marker. local sX, sY = guiGetScreenSize(); local pX, pY = 1920, 1080; local fuelMarker = createMarker(-2524.38452, -618.74219, 130.65250, "cylinder", 2, 0, 0, 100, 175); CPosX = 778; function rajz() benzin = math.floor(((312*((CPosX-804)/312))+26)/3.02) dxDrawRectangle(762/pX*sX, 400/pY*sY, 396/pX*sX, 300/pY*sY, tocolor(0, 0, 0, 200), false); dxDrawRectangle(802/pX*sX, 500/pY*sY, 316/pX*sX, 30/pY*sY, tocolor(142, 147, 140, 200), false); dxDrawRectangle(804/pX*sX, 502/pY*sY, (312*((CPosX-804)/312))+26/pX*sX, 26/pY*sY, tocolor(73, 82, 140, 200), false); dxDrawRectangle(842/pX*sX, 630/pY*sY, 236/pX*sX, 50/pY*sY, tocolor(183, 86, 67, 200), false); dxDrawRectangle(842/pX*sX, 560/pY*sY, 236/pX*sX, 50/pY*sY, tocolor(51, 153, 48, 200), false); dxDrawText("Mégse",842/pX*sX, 630/pY*sY, 1078/pX*sX, 680/pY*sY, tocolor(250, 250, 250, 250), 1.1,"default", "center","center", false,false,false,true); dxDrawText("Fizetés", 842/pX*sX, 560/pY*sY, 1078/pX*sX, 610/pY*sY, tocolor(250, 250, 250, 250), 1.1,"default", "center","center", false,false,false,true); dxDrawText(benzin.." liter".." = "..((math.floor(((312*((CPosX-804)/312))+26)/3.02))*3).." $",802/pX*sX, 440/pY*sY, 1118/pX*sX, 470/pY*sY, tocolor(39, 194, 182, 250), 1.5,"default", "center","center", false,false,false,true); dxDrawText("Fizetendő:",802/pX*sX, 400/pY*sY, 1118/pX*sX, 450/pY*sY, tocolor(84, 89, 118, 250), 1.5,"default-bold", "center","center", false,false,false,true); dxDrawText(benzin.." liter", 802/pX*sX, 500/pY*sY, 1118/pX*sX, 530/pY*sY, tocolor(250, 250, 250, 250), 1.1,"default", "center","center", false,false,false,true); showCursor(true); end function asd (hitPlayer, mDim) if (mDim) then if (source == fuelMarker) then if (hitPlayer == localPlayer) then local vehicle = getPedOccupiedVehicle(hitPlayer); if (vehicle) then local seat = getPedOccupiedVehicleSeat(hitPlayer); if (seat == 0) then setElementFrozen(hitPlayer, true); setElementFrozen(vehicle, true); addEventHandler("onClientRender", root, rajz); addEventHandler("onClientClick", root, function(button, state) if button == "left" then if state == "up" then if isInSlot(804/pX*sX, 502/pY*sY, 312/pX*sX, 26/pY*sY) then CPosX, CPosY = getCursorPosition() CPosX, CPosY = CPosX*sX, CPosY*sY if (CPosX <= 778) then CPosX = 778; elseif (CPosX >= 1116) then cPosX = 1; end end end end end ); addEventHandler("onClientKey",root, function(key,state) if state then if isCursorShowing() then if key == "mouse1" then if isInSlot(842/pX*sX, 630/pY*sY, 236/pX*sX, 50/pY*sY) then removeEventHandler("onClientRender", root, rajz); showCursor(false); local vehicle = getPedOccupiedVehicle(hitPlayer); setElementFrozen(hitPlayer, false); setElementFrozen(vehicle, false); CPosX = 778; elseif isInSlot(842/pX*sX, 560/pY*sY, 236/pX*sX, 50/pY*sY) then local vehicle = getPedOccupiedVehicle(hitPlayer); local fuel = getElementData(vehicle, "fuel"); local fizetendo = ((math.floor(((312*((CPosX-804)/312))+26)/3.02))*3); local lesz = fuel + (fizetendo/3) ir = 1; if ((fizetendo/3) > 0) then ir = 0; ir2 = 1; if (lesz <= 100) then ir2 = 0; ir3 = 1; local pMoney = getPlayerMoney(localPlayer); if (pMoney >= fizetendo) then ir3 = 0; showCursor(false); removeEventHandler("onClientRender", root, rajz); setTimer( function() local vehicle = getPedOccupiedVehicle(hitPlayer); setElementFrozen(hitPlayer, false); setElementFrozen(vehicle, false); triggerServerEvent("fizetes", resourceRoot, benzin); outputChatBox("#FFFFFF[Szerver]: A jármű megtankolva!#AAAAAA Levonunk tőled "..fizetendo.."$-t a tankolásra!", 0, 0, 0, true); end, (1000)*(fizetendo/3),1); CPosX = 778; elseif (ir3 == 1) then setTimer( function() outputChatBox("#FFFFFF[Szerver]:#FF0000 Nincs ennyi pénzed!", 0, 0, 0, true); ir3 = 0; return; end ,300,1); end elseif (ir2 == 1) then setTimer( function() outputChatBox("#FFFFFF[Szerver]:#FF0000 Nem fér bele ennyi benzin a kocsidba!", 0, 0, 0, true); ir2 = 0; return; end ,300,1); end elseif (ir == 1) then setTimer( function() outputChatBox("#FFFFFF[Szerver]:#FF0000 Nem adtad meg a tankolni kívánt mennyiséget!", 0, 0, 0, true); ir = 0; return; end ,300,1); end end end end end end ); end end end end end end addEventHandler("onClientMarkerHit", root, asd); function isInSlot(x, y, w, h) if isCursorShowing() then cPosX, cPosY = getCursorPosition() cPosX, cPosY = cPosX*sX, cPosY*sY if ( (cPosX > x) and (cPosY > y) and (cPosX < x+w) and (cPosY < y+h) ) then return true else return false end end end
  3. local gate = createObject (10558, 1588.6999511719, -1638.5, 14.39999961853, 0, 0, 270); function handleGate(player) gX, gY, gZ = getElementPosition(gate); if ( (gX >= 1588.6999511719) and (gY >= -1638.5) and (gZ >= 14.39999961853) ) then -- HA a kapu csukva van moveObject(gate, 5000, 1588.6999511719, -1638.5, 10, 0, 0, 0); elseif ( (gX >= 1588.6999511718) and (gY >= -1638.5) and (gZ <= 10.00002) ) then moveObject(gate, 5000, 1588.6999511719, -1638.5, 14.39999961853, 0, 0, 0); end end addCommandHandler("gate", handleGate, false, false);