Jump to content

Dzsozi (h03)

Members
  • Posts

    696
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Dzsozi (h03)

  1. function drawJoin() dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(name, 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("csatlakozott a szerverre.", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end
  2. Do you mean this? -- Dx things dxDrawText(name, 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) -- Dx things addEventHandler("onClientPlayerJoin", root, function() name = getPlayerName(source) addEventHandler("onClientRender", root, drawJoin) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawJoin) end, 5000, 1 ) end )
  3. Hey guys! Today I made a dxDraw script which is shows who joined/quited to/from the server. But it doesn't show the player's name! I tried everything but it doesn't work. Debugscript shows me 2 errors: And the name is not shown, as you can see on the right. How can I fix this? Here's the code: function drawJoin() dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(getPlayerName(source), 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("csatlakozott a szerverre.", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end function drawQuit(reason) dxDrawRectangle(1411, 228, 269, 84, tocolor(0, 0, 0, 125), true) dxDrawRectangle(1411, 228, 269, 21, tocolor(245, 140, 20, 235), true) dxDrawText("Csatlakozás / Kilépés", 1425, 234, 1680, 244, tocolor(254, 254, 254, 235), 1.00, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(getPlayerName(source), 1470, 249, 1657, 280, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("lecsatlakozott a szerverről. ("..reason..")", 1455, 285, 1675, 302, tocolor(255, 255, 255, 255), 1.10, "default", "center", "center", false, false, true, false, false) end addEventHandler("onClientPlayerJoin", root, function() addEventHandler("onClientRender", root, drawJoin) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawJoin) end, 5000, 1 ) end ) addEventHandler("onClientPlayerQuit", root, function() addEventHandler("onClientRender", root, drawQuit) local sound = playSound("bip.wav") setTimer ( function() removeEventHandler("onClientRender", root, drawQuit) end, 5000, 1 ) end ) Please help me. Thank you!
  4. How ? To disable the F11 map use this: toggleControl("radar", false) And if you want to add an information about why is this disabled: toggleControl("radar", false) bindKey("F11", "down", function() outputChatBox("Your text here", thePlayer, 255, 0, 0, true) end ) OR if you use this notifications system: https://community.multitheftauto.com/in ... ls&id=5812 then it's: toggleControl("radar", false) bindKey("F11", "down", function() exports.notifications:showBox('info', "Your text here") end )
  5. Doesn't work But I have an admin system and globals. I'm asking that how could I make exports.global:sendMessageToAdmins client sided or how to connect the client functions, (when somebody punches a vehicle) with server function (what I'm asking for [the exports.global bla bla] ). I have a client sided script only: addEventHandler("onClientVehicleDamage", root, function (attacker,weapon) if attacker == localPlayer and weapon == 0 then exports.notifications:showBox( 'warning', "Ne üsd a kocsikat! Ha folytatod üzenet lesz küldve az adminok számára és gondok is lehetnek belőle!") end if attacker then cancelEvent() end end) So how can I attach exports.global:sendMessageToAdmins to this script?
  6. Uhh. Can you explain it more please? I'm not as professional scripter as others or as you. Or can you write me a lua example with random numbers? I will position and color it and anything, but I don't really know the setElementData thing and the timers. Could you help me with this? I mean this part of the script.
  7. One more thing. How could I make a hunger bar with dxDrawRectangle? I want to make a hunger bar which is like the other bars (armor and health), so it has a timer and the dx bar is going down slowly. When it reaches 0 the hp starts to go down as well. But how could I make a bar for hunger and a timer to lower it? Can you help me in this please? I would be grateful!
  8. Hummm the two piece of code I gave you were only for the two bars (health and armor) not for the background oO But if you say you fixed it, then it's okay. I just had to fix the bars.
  9. Hello everyone! So I made a little script which is warns you if you punch the car with fist. But I want to make it to send a message to admins with a player name when somebody punches a car. But I don't know how can I make sendMessageToAdmins as a client side function, or how to trigger the client side things to server side and then in server side make the message to send. Can somebody help me in this please? Thank you!
  10. Yeah, it helps a lot, I could fix the health and armor bars: Replace line 11 by this: local maxHealthWidth = screenX*0.0654 - 0.003 dxDrawRectangle(screenX*0.238 , screenY*0.819, hp*maxHealthWidth/100, screenY*0.0142, tocolor(135, 34, 34, 200)) Replace line 16 by this: local maxArmorWidth = screenX*0.0654 - 0.003 dxDrawRectangle(screenX*0.238 , screenY*0.8523, arm*maxArmorWidth/100, screenY*0.0142, tocolor(93, 125, 150, 200)) Instead of screenX*0.0654 - 0.003 I should write screenX*0.059, but now it's perfect! It fits the background on all resolutions! Thank you very much! Wasn't the perfect, instead of local maxHealthWidth = screenX*0.0654 - 0.003 I should write 0.059 to fit correctly, but now it's good! Thank you very much!! The problem seems to come from the radar positioning/sizing. I would like to see this part of the radar code. Or maybe a fullscreen (do not edit) of the hud in your resolution. Thanks.
  11. Hey guys! I decided to make an AFK system which is put an image above your head if you not move for example 2 minutes. The problem is that I don't know how to start it and how to make a "3D" image above people's head. Maybe some chat icon system could help but I don't know how. So could anyone help me in this please? So a little picture above players head if they don't move or if they enable the main menu (press escape). I would be grateful if anyone could help me in this. Thank you!
  12. local screenX, screenY = guiGetScreenSize() dxDrawImage(screenX*0.145, screenY*0.744, screenX*0.25, screenY*0.19, "bgt.png") local hp = getElementHealth (localPlayer) -- 1310, 860, 16, 16 dxDrawImage(screenX*0.22, screenY*0.82, screenX*0.00952, screenY*0.01523, "heal.png") -- 1285, 855, 110, 25 -- 1280, 860, hp, 15 dxDrawRectangle(screenX*0.235 , screenY*0.8142, screenX*0.0654, screenY*0.0238, tocolor(0, 0, 0, 150)) dxDrawRectangle(screenX*0.238 , screenY*0.819, hp, screenY*0.0142, tocolor(135, 34, 34, 200)) local arm = getPedArmor (localPlayer) dxDrawImage(screenX*0.22, screenY*0.8515, screenX*0.00952, screenY*0.01523, "kevlar.png") dxDrawRectangle(screenX*0.235 , screenY*0.8476, screenX*0.0654, screenY*0.0238, tocolor(0, 0, 0, 150)) dxDrawRectangle(screenX*0.238 , screenY*0.8523, arm, screenY*0.0142, tocolor(93, 125, 150, 200)) local oxy = getPedOxygenLevel (localPlayer) dxDrawImage(screenX*0.313, screenY*0.82, screenX*0.00952, screenY*0.01523, "ox.png") dxDrawRectangle(screenX*0.327 , screenY*0.81333, screenX*0.0238, screenY*0.10095, tocolor(0, 0, 0, 150)) -- 1125, 950, 27, 5 if oxy > 0 then dxDrawImage(screenX*0.3305, screenY*0.9047, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 100 then dxDrawImage(screenX*0.3305, screenY*0.8952, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 200 then dxDrawImage(screenX*0.3305, screenY*0.8857, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 300 then dxDrawImage(screenX*0.3305, screenY*0.8761, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 400 then dxDrawImage(screenX*0.3305, screenY*0.8666, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 500 then dxDrawImage(screenX*0.3305, screenY*0.8571, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 600 then dxDrawImage(screenX*0.3305, screenY*0.8476, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 700 then dxDrawImage(screenX*0.3305, screenY*0.8380, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 800 then dxDrawImage(screenX*0.3305, screenY*0.8285, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end if oxy > 900 then dxDrawImage(screenX*0.3305, screenY*0.8190, screenX*0.01607, screenY*0.00476, "oxy-bar.png") end Hope this helps
  13. Here's another picture of the buggy hp bar: It's 1360x768 resolution
  14. Hey everyone! So I'm trying to make a "dashboard" for cars, when you click on a gui button it should turn on and off vehicle engines and lights if you are in the car and you are sitting on the driver seat. But I can't decide and make this. It doesn't work when I click on a gui button, so can anybody help me with this? I've got a half script, but the engine and light turn on and off and the other things like handbrake are doesn't work. I would be grateful if anyone could help me in this. Thank you!
  15. And you are wrong again ... The code is obviously not okay ! Did you see the screenshots he made come on, use your brain. @Dzsozi: I need to know the screen resolution of the first screenshot and if both screenshots had been just cropped/trimmed and not zoomed in or out The player's resolution on the first picture is 1360x768 pixels. The HP and Armor bar is a little bit larger than the background on their resolution. Anything else you need to know to help me?
  16. Stop this! I just wanted to know how to make a dxRectangle, which is used as a health bar fit in any resolutions, because instead of numbers it is defined as "hp". And I don't know how to make it fit correctly on all resolutions. Help please. Don't fight.
  17. Please don't help others when you can't even help yourself ... Well, the script should be fine, can you show us a screen when the hp bar fits correctly ? Thanks really ? he didnt define screenX and screenY .. and how it will work correctly without guiGetScreenSize ? he want it to fit in the same place for any resolution. btw do u have any problem if i tried to help ? I haven't mentioned it but I've written it in the script.
  18. Here is my resouliton, it's 1680x1050, and as you can see it fits correctly:
  19. Hello people! I made a Dx HUD, and the problem is that I don't know how to attach guiGetScreenSize to a HP bar, so in lower resolutions the HP bar looks like this Can somebody help me how to make the HP bar fit the background? Thank you! Bit of the script: local hp = getElementHealth(localPlayer) dxDrawRectangle(screenX*0.235 , screenY*0.8142, screenX*0.0654, screenY*0.0238, tocolor(0, 0, 0, 150)) dxDrawRectangle(screenX*0.238 , screenY*0.819, hp, screenY*0.0142, tocolor(135, 34, 34, 200)) P.S.: In my resolution it fits correctly.
×
×
  • Create New...