Jump to content

JeViCo

Members
  • Posts

    605
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JeViCo

  1. JeViCo

    XML problem

    debugscript + logs - nothing
  2. JeViCo

    XML problem

    Hello guys, i have a problem. --------LOADING POSITION if not fileExists("settings.xml") then local x, y, z = getElementPosition(player) local settingsXML = xmlCreateFile("settings.xml", "settings") xmlNodeSetAttribute(xmlCreateChild(settingsXML, "positionX"), "x", "false") xmlNodeSetAttribute(xmlCreateChild(settingsXML, "positionY"), "y", "false") xmlSaveFile(settingsXML) xmlUnloadFile(settingsXML) chatbox.posX = screenX/2-200 chatbox.posY = 10 + chatbox.tabHeight else local settingsXML = xmlLoadFile("settings.xml") local positionX = xmlFindChild(settingsXML, "positionX", 0) if positionX then local x = xmlNodeGetAttribute(positionX, "x") chatbox.posX = tonumber(x) or 10 end local positionY = xmlFindChild(settingsXML, "positionY", 0) if positionY then local y = xmlNodeGetAttribute(positionY, "y") chatbox.posY = tonumber(y) or 10 + chatbox.tabHeight end xmlUnloadFile(settingsXML) end this part of dx chat doesn't work. How can i fix it? Should i write something in meta.xml to make it work?
  3. I tried to remake it and it worked. I copied health bar more to the right, removed old one and made (-healh) on coordinates. Thank you) i was trying to manage with @DNL291's script until i opened wiki of dxDrawRectangle. It said that i use at least first coordinate + width + height. @#RooTs suggested to draw health bar backwards. Why not? Thanks everyone!
  4. Doesn't work( It is a progress bar instead now with(
  5. local timer = {} --задал, что таймер в виде пустой таблицы Насколько я понял, в 1 строке был указан тип переменной и значение (пусто, значит nil). По сути ты убираешь таймер, его значение равно 0 и ему опять присваивается 0. 0 = 0 killTimer ( timer[thePlayer] ) -- убирается сам таймер (#1) timer[thePlayer] = nil -- значению времени таймера присваивается 0, то есть nil(#2)
  6. timer[thePlayer] = nil не обязательно. Он уже исчезнет по killTimer
  7. BUT now what should i paste in here: dxDrawRectangle (x*447, y*615, x*235/100*inRenderHealth, y*21, tocolor(255, 0, 0, 255), false) i understood that this is kind of render + functions until dxDrawRectangle ( 0, 0, inRenderHealth * 4, 20 ) is that health? and why *4 ?
  8. thanks everyone, i got i now)
  9. Hello again I'm making some kind of HUD and i want to know, how to make health bar move backwards? local sx,sy = guiGetScreenSize() local px,py = 1280,720 local x,y = (sx/px), (sy/py) dxDrawLine(x*447 - 1, y*615 - 1, x*447 - 1, y*636, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(x*682, y*615 - 1, x*447 - 1, y*615 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(x*447 - 1, y*636, x*682, y*636, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(x*682, y*636, x*682, y*615 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(x*447, y*615, x*235/100*health, y*21, tocolor(255, 0, 0, 255), false) --health i think i'm close but still can't figure it out
  10. or open mtaserver.conf, look for <fpslimit>36</fpslimit> line and replace it with <fpslimit>70</fpslimit> after - stop and start your server.
  11. Hello. For example i have a hud and health bar looks like long line. When i get damage, it instantly become shorter with no animation. I had an idea - combine setTimer and dxDrawRectangle BUT i remembered explosions with -70% HP. I don't have any ideas. Can i make this a way easier or somehow else?
  12. try this: https://wiki.multitheftauto.com/wiki/SetPedWalkingStyle SA:MP use default CJ's walking while MTA - Default player's
  13. Thank you for reply! I've just figured it out with this function It works!
  14. yes, it's close but problem still exists. When player opens chat, he/she can type any letter. Is it possible with GetKeyState ?
  15. Hello everyone! I have a DX chat, but it have some bugs. It happens when i'm typing any letter and remove text at the same time. How can i temporary disable any key while Backspace is pressed? I need a condition of binding to any letter or sth like that
  16. already tried this( Thank you, it works. But what was wrong?
  17. Hi! I tried to make custom weapon stats, but got this: Here: function stats() setWeaponProperty(30, "poor", "maximum_clip_ammo", 1) end addEvent("stats",true) addEventHandler ("stats", root, stats) Tried to use wiki code - same
  18. Доброго времени суток! Я столкнулся с такой проблемой, как длинное условие: if (press) and button=="0" or (press) and button=="1" or (press) and button=="2" or (press) and button=="3" or (press) and button=="4" or (press) and button=="5" or (press) and button=="6" or (press) and button=="7" or (press) and button=="8" or (press) and button=="9" then как это можно сократить? числа в диапазоне от 0 до 9 нужно буквально в 1-2 строки записать\\
  19. nope if (press) and button=="0" or (press) and button=="1" or (press) and button=="2" or (press) and button=="3" or (press) and button=="4" or (press) and button=="5" or (press) and button=="6" or (press) and button=="7" or (press) and button=="8" or (press) and button=="9" then i tried this and it works, but it's so long. Have no ideas to make this part of code less
  20. thanks, now it works, but now i have 2 problems. onClientKey event makes this script work twice - when key is pressed and whet it released(with the exception of key "0"). Also i don't know how to make this conditions less: button=="0" or button=="1" or button=="2" or button=="3" or button=="4" or button=="5" or button=="6" or button=="7" or button=="8" or button=="9" then How can i fix that all?
  21. client function PressedKey(button, press) if (press) and button=="1" then outputChatBox("Seems to work") // detect button press triggerServerEvent("weap_change",localPlayer,button) end end addEventHandler("onClientKey", root, PressedKey) server addEvent("weap_change",true) addEventHandler("weap_change",root,function () setPedWeaponSlot(source,button) // button not found in here end ) I'm going to make 0-9 numbers action
  22. just trying to switch weapons by pressing numbers on keyboard and that's it
×
×
  • Create New...