Jump to content

rusztamas

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by rusztamas

  1. local allapot = "bekapcsolva" while allapot == "bekapcsolva" do function pajzsLekerdezes() pajzs = getElementArmor (source) if pajzs >= 1 then setElementData (source, "lehetPajzsa", true) else setElementData (source "lehetPajzsa", false) end end end pajzsobject = createObject (1242, 0, 0, 1000) function pajzsMegjelenitese() if getElementData (source, "lehetPajzsa") == true then setElementData (pajzsobject, "rogzitve", true) attachElements (pajzsobject, source) elseif getElementData (source, "lehetPajzsa") == false and getElementData (pajzsobject, "rogzitve") == true then destroyElement (pajzsobject) end end addEventHandler("", getRootElement()) I'd like to make a script, in which you have armor, an armor object would attach on you, else it would be destroyed or not shown. Aborts infinite loop?
  2. The problem has not been solved yet. Tried to switch the two lines in the meta, but was not succesful. Solved: I made a function for them, and on event onResourceStart it starts running, and get delayed by 2500ms. I'm running this on my PC, the CPU might not be as fast as the Xeon on my server lol.
  3. Hi! Sorry, i would not like to post the whole source code, because it is really creative. But, when i start the script, there is a "triggerClientEvent" right away, and there is a big lag, camera stops for 3 seconds. Then this is what the debugscript is writing. It makes me really furious, i'm trying to fix this since morning, but i could not fix it. Declarations and basic things: local szef = createObject (2634, 2370.0651855469+0.05, -1913.1561279297+0.20, 13.449999809265+0.30) local szefmarker = createMarker(2370.1186523438, -1911.3524169922, 13.449999809265-1, "cylinder", 1, 161, 212, 144) local kamuszefmarker = createMarker(2370.1186523438, -1911.3524169922, 13.449999809265-1, "cylinder", 4, 161, 212, 144) local kapu = createObject (980, 2403.6474609375, -1909.4417724609+10, 13.573752403259+0.05) setElementRotation (kapu, 0, 0, 90) setElementAlpha (kamuszefmarker, 0) setElementData (szef, "rabolhato", true) setElementData (szef, "zart", true) setElementData (szef, "allapot", "0") triggerClientEvent ("kepekEngedelyezese_Szef", getRootElement()) triggerClientEvent ("kepekTiltasa_Zsak", getRootElement()) After this the functions start. Clientside: function kepekTiltasa_Szef() setElementData (kamuszefmarker, "megjelenitheti_a_kepet", false) end addEvent ("kepekTiltasa_Szef", true) addEventHandler ("kepekTiltasa_Szef", getRootElement(), kepekTiltasa_Szef) function kepekEngedelyezese_Szef() setElementData (kamuszefmarker, "megjelenitheti_a_kepet", true) end addEvent ("kepekEngedelyezese_Szef", true) addEventHandler ("kepekEngedelyezese_Szef", getRootElement(), kepekEngedelyezese_Szef) function kepekTiltasa_Zsak() setElementData (kamupenzeszsakmarker, "megjelenitheti_a_kepet", false) end addEvent ("kepekTiltasa_Zsak", true) addEventHandler ("kepekTiltasa_Zsak", getRootElement(), kepekTiltasa_Zsak) function kepekEngedelyezese_Zsak() setElementData (kamupenzeszsakmarker, "megjelenitheti_a_kepet", true) end addEvent ("kepekEngedelyezese_Zsak", true) addEventHandler ("kepekEngedelyezese_Zsak", getRootElement(), kepekEngedelyezese_Zsak) Says it is not added to clientside......... I dont know what the problem could be. Any help please?
  4. Yes, this fixed the lag. Thank you very much, now i can continue the script.
  5. function drawSzef_alap() local kamuszefmarker = createMarker(2485.787109375, -1663.3155517578, 13.335947036743-1, "cylinder", 4, 161, 212, 144) setElementAlpha (kamuszefmarker, 0) if isElementWithinMarker (localPlayer, kamuszefmarker) then local x, y = guiGetScreenSize() dxDrawImage (x/2, y/2, 500, 300, "fajlok/kepanyag/szef[0].png") else end end addEventHandler ("onClientRender", getRootElement(), drawSzef_alap) I tried to be creative But still lagging. What could be the problem?
  6. I've got a marker, created on serverside, and i made an onClientRender for it, and says: The serverside marker is below, and clientside script is under it. local kamuszefmarker = createMarker(2485.787109375, -1663.3155517578, 13.335947036743-1, "cylinder", 4, 161, 212, 144) function drawSzef_alap() function drawSzef_alap_renderer() if isElementWithinMarker (localPlayer, kamuszefmarker) then local x, y = guiGetScreenSize() dxDrawImage ("fajlok/kepanyag/szef[0].png", x/2, y/2, 500, 300) else end end addEventHandler ("onClientRender", getRootElement(), drawSzef_alap_renderer) end addEventHandler ("onClientRender", getRootElement(), drawSzef_alap) And i'm really lagging right now BTW my cpu slowed down AF, event the characters i type here are delayed. Guess, because of the onClientRenders. Any ideas?
  7. local szefpozicio = {"2485.87524, -1666.34705, 13.34380", "2487.87526, -1666.34705, 13.34380"} local szef = createObject (2634, tonumber(szefpozicio[0])) local szefrectangle = createColRectangle (2485.8720703125, -1665.8211669922, 5, 5) function szefopen(jatekos) if isElementWithinColShape (jatekos, szefrectangle) then moveObject (szef, 5000, tonumber(szefpozicio[1])) outputChatBox (math.random(1, 2)) end end addCommandHandler ("felfeszit", szefopen) It supposed to open on command enter "felfeszit". But: WARNING: teszt\bankrob.CodeS.lua:2: Bad argument @ 'createObject' [Expected vector3 at argument 2, got nil]
  8. Hi! I'd like to make an object which is attached to the player, and "floats" above his head, like, up and down, slowly. But i dont know how to make the object return to its previous position. I think i dont need timers and triggers here, just simple lua, but i dont really know the way how to do it. It would look like this: Places object( Moves object up, in 1000ms Moves the object down in 1000ms.) This would be forever.
  9. Code: function koth_Csatlakozas() end function koth_Idozito() idozito = setTimer (function() end, 60000, 1) end addEvent ("koth_Idozito", false) addEventHandler ("koth_Idozito", getRootElement(), koth_Idozito) function koth_DxJelzes() local sX, sY = 1366, 768 -- sajátX, sajátY local jX, jY = guiGetScreenSize() -- játékosX, játékosY triggerEvent ("koth_Idozito", localPlayer) local idozitostatusz = tostring(getTimerDetails(idozito)) local dxrectangle = dxDrawRectangle (570/sX*jX, 25/sY*jY, 250/sX*jX, 20/sY*jY, tocolor (0, 0, 0, 150)) local dxtimer = dxDrawRectangle (575/sX*jX, 30/sY*jY, 240*idozitostatusz/60000/sX*jX, 10/sY*jY, tocolor (255, 255, 255, 200)) outputChatBox (idozitostatusz) end addEventHandler ("onClientRender", getRootElement(), koth_DxJelzes) Simple DX hud, and it would display how many time left from a match. No errors, but the timer stays the same, it outputs the chatbox 60000. It should be like 6000, 59000 and else. Why isn't the timer going? (This is just a little piece of the script, it's unfinished.) Fixed! Problem was: the function triggerer was inside an event "onClientRender", so it was "looping" for ever.
  10. Hi! I made a dxDraw Gui and it contains 3 texts, and 3 rectangles. All of them has been defined, as values/instructions, so they could be used as variables. Script: function dxDraw() showCursor(true) local mX, mY = 1366, 768 local jX, jY = guiGetScreenSize() hatter = dxDrawRectangle (jX/3.2, jY/4, 500, 350, tocolor(0, 0, 0, 150)) -- háttér hattertext = dxDrawText ("Csatlakozol?", jX/3.2+130, jY/4+75, _, _, _, 3, "sans", "left", "top") -- háttér szöveg igen = dxDrawRectangle (jX/3, jY-300, 150, 50, tocolor(0, 200, 0, 150)) -- igen igentext = dxDrawText ("Igen", jX/2-195, jY-300, _, _, _, 3, "sans", "left", "top") -- igen szöveg nem = dxDrawRectangle (jX/3+295, jY-300, 150, 50, tocolor(0, 200, 0, 150)) -- nem nemtext = dxDrawText ("Nem", jX/3+325, jY-297, _, _, _, 3, "sans", "left", "top") -- nem szöveg end addEventHandler ("onClientRender", getRootElement(), dxDraw) function nemclick() destroyElement (hatter) end addEventHandler("onClientGUIClick", nem, nemclick) my problem, is when i click on rectangle "nem" the rectangle "hatter" is not getting destroyed, but stays the same. what the problem could be?
  11. Hello! I started making a Battle Royale server a few days ago, and now i set the timers for the matches. I'm making a dxDrawRectangle hud for it too, and i don't know how to call how the timer is going. So i would make a background rectangle, and a front rectangle, and it would move slowly down, and down. By using onClientRender and getting the remaining time. Any function name? Thanks!
  12. I think it was too far away from the gta sa map. We put it above los santos, and it was working perfectly up there
  13. on server (213.181.201.12:22004) if you really need the password i can give it to you in pm so you can check out the bug
  14. Hi! Me and my friends cant use the mapeditor properly. We save the map, if we can, because sometimes it wont let us to, we reconnect and there are like "random objects collided" to each other, and there are control bugs, if i try to move an object my camera is moving, as well as the object does. What happened? A while ago it worked perfectly. I downloaded the newest mta version from mtasa.com to my vps, since then i saw there was a new update kind of thing, but i dont know if this is the problem. Any help please?
  15. i definied it, like local deathimg = dxDrawImage(............), and how can i destroy it? it says that destroyElement(deathimg)'s first argument got nil, now what?
  16. Hi! I want to make a script, in which you die, an image appears. It really does, but only just for like not even for a second. About half a second. And i could see the image in game, after triggering it, but it disappeared immediately. function startHalalMusic() local halalMusic = playSound ("assets/death.mp3") local dX, dY, dZ = getElementPosition(localPlayer) setCameraMatrix (dX+5, dY+5, dZ+5, dX, dY, dZ) setPlayerHudComponentVisible ("all", false) local x, y = guiGetScreenSize(localPlayer) local img = dxDrawImage (x/2, y/2, 500, 500, "assets/death.png") showChat (false) end addEvent("startHalalMusic", true) addEventHandler("startHalalMusic", getRootElement(), startHalalMusic) function stopHalalMusic() end addEvent("stopHalalMusic", true) addEventHandler("stopHalalMusic", getRootElement(), stopHalalMusic) function ujraeledes() local varjalMar = setTimer( function() triggerServerEvent ("respawnJatekos", localPlayer) setPlayerHudComponentVisible ("all", true) outputChatBox ("#A1D490[King of the Hill]#FFFFFF Újra éledtél.", 255, 255, 255, true) showChat (true) end, 6000, 1) end addEvent ("ujraeledes", true) addEventHandler ("ujraeledes", getRootElement(), ujraeledes) I really barely can see the image, but it disappears, right away.
  17. Now it writes no errors, but nothing is happening after i die. Just the simple gta-sa "shaking" animation.
  18. SCRIPT ERROR: koth\koth.codeS_Death.lua:13: ')' expected (to close '(' at line 11) near '0'
  19. Hi! I want to use smoothMoveCamera, but i don't really understand how. function moveCamera() local deathX, deathY, deathZ = getElementPosition(source) setCameraMatrix (deathX, deathY, deathZ, deathX, deathY, deathZ+50) end addEventHandler ("onPlayerWasted", getRootElement(), moveCamera) The thing i want to do, it to move from deathZ to deathZ+50 in for example 30 seconds, and i think i can use smoothMoveCamera for this, but i dont know how. Could you please help me?
  20. SCRIPT ERROR: koth\koth.codeS_Death.lua:18: unexpected symbol near ')' function 'ujraeledes' is from line 9 to 18.
  21. Hi! I want to make a death script to my server. It should do this: -when you die, sets your camera matrix to you, from the sky -starts playing a 2m music -sets timer to 2m, -after 2m timer, you should respawn ...but i get errors. Script: serverside: function halal() local halottX, halottY, halottZ = getElementPosition(source) setCameraMatrix (source, halottX, halottY, halottZ+15, halottX, halottY, halottZ) triggerClientEvent ("startHalalMusic", source) triggerEvent ("ujraeledes", source) end addEventHandler ("onPlayerWasted", getRootElement(), halal) function ujraeledes() local varjalMar = setTimer( function() spawnPlayer (source, 0, 0, 0) setCameraTarget (source, source) fadeCamera (source, true) triggerClientEvent ("stopHalalMusic", source) end end, 120000, 1 ) addEvent ("ujraeledes", true) addEventHandler ("ujraeledes", getRootElement(), ujraeledes) Clientside: function startHalalMusic() local halalMusic = playSound ("assets/death.mp3") end addEvent("startHalalMusic", true) addEventHandler("startHalalMusic", getRootElement(), startHalalMusic) function stopHalalMusic() stopSound (halalMusic) end addEvent("stopHalalMusic", true) addEventHandler("stopHalalMusic", getRootElement(), stopHalalMusic) koth\koth.codeS_Death.lua:16: ')' expected (to close '(' at line 10) near 'end' Please help.
×
×
  • Create New...