Jump to content

Fist

Members
  • Posts

    433
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Fist

  1. mods > gta mod forums. model importing > -- txd engineLoadTXD engineImportTXD -- dff engineLoadDFF engineReplaceModel -- there are already examples in their wiki pages. sounds can be replaced with playSound3D
  2. So... You wanna tell me that you offer people to buy crap version of dayz gamemode for 20 eur? Who even sorts resources like that, so much crapy scripts which are 1 min to write have their own resource folder. whaat? Not even talking 'bout the ordinary "bugfix/feautures" which comes with purchase. ayy lmao.
  3. just use event onClientPedDamage then just show hit mark image, no delay whatsoever.
  4. you can not use 'destroyElement' to destroy/hide dx drawing function 'cause it's not an element. You have to use some kind of variable to know if that dx drawing need to be draw. Also don't use 'guiGetScreenSize' or 'showCursor' function in 'onClientRender' eventHandler. It's no need for that it will do fine if you call it once not constantly when player updates frames. local mX, mY = 1366, 768 local jX, jY = guiGetScreenSize() local showDxDrawing = false; function dxDraw() if (not showDxDrawing) then return; end 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() showDxDrawing = not showDxDrawing; showCursor(not isCursorShowing()) end addEventHandler("onClientGUIClick", nem, nemclick) EDIT: @rusztamas just noticed, you used GUI event handler to detect DX click. You CAN NOT use GUI events to detect DX 'cause DX is not same as GUI. You can use "useful function" from wiki 'isMouseInPosition' and event 'onClientKey' to detect dx click. correct code would be this local mX, mY = 1366, 768 local jX, jY = guiGetScreenSize() local showDxDrawing = false; function dxDraw() if (not showDxDrawing) then return; end dxDrawRectangle (jX/3.2, jY/4, 500, 350, tocolor(0, 0, 0, 150)) -- háttér dxDrawText ("Csatlakozol?", jX/3.2+130, jY/4+75, _, _, _, 3, "sans", "left", "top") -- háttér szöveg dxDrawRectangle (jX/3, jY-300, 150, 50, tocolor(0, 200, 0, 150)) -- igen dxDrawText ("Igen", jX/2-195, jY-300, _, _, _, 3, "sans", "left", "top") -- igen szöveg dxDrawRectangle (jX/3+295, jY-300, 150, 50, tocolor(0, 200, 0, 150)) -- nem dxDrawText ("Nem", jX/3+325, jY-297, _, _, _, 3, "sans", "left", "top") -- nem szöveg end addEventHandler ("onClientRender", getRootElement(), dxDraw) -- function from wiki.multitheftauto.com (not written by me) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function nemclick(button,press) if (isMouseInPosition(jX/3+295, jY-300, 150, 50)) then if (button == "mouse1" and press) then showDxDrawing = not showDxDrawing; showCursor(not isCursorShowing()); end end end addEventHandler("onClientKey", root, nemclick);
  5. Fist

    Chat

    Did you put it on server side? Did it have any errors? If no then it could be the way i used eventHandlers. Then just do this. (it's server side) addEventHandler("onPlayerLogin",root,function() setElementData(source,"logedin",true); end); addEventHandler("onPlayerChat",root,function() if (not getElementData(source,"logedin")) then cancelEvent(); end end);
  6. Fist

    Chat

    you do understand that you can still enable it back with console command 'showchat' or even with console command 'say text' which would work as chat aswell. You have to simply disable event when player chats. @TorNix~|nR function blockChat() cancelEvent(); end addEventHandler ("onPlayerConnect",root,function() addEventHandler("onPlayerChat",source,blockChat); end); addEventHandler("onPlayerJoin",root,function() removeEventHandler("onPlayerChat",source,blockChat); end)
  7. Please, explain better your request/problem. Otherwise no one will help 'cause anyone (atleast me) can't understand what are you talking about.
  8. Fist

    Chat

    @TorNix~|nR it didn't work 'cause guest account is not set by default when player joins. addEventHandler("onPlayerChat",root,function()) if (not isPedDead(source)) then cancelEvent(); end end); You can try by setting their account as guest when they join or using this. but keep in mind, this will even block dead player messages that are logged in. There is even better way doing it, by setting elementdata or variable "logedin = false" when player joins then when player logins in server then set their var to "logedin = true" and then just check when player tries to chat if their var logedin is false then cancel event. (This easier would be to do with setElementData and getElementData)
  9. Fist

    Serials

    when someone register's just set new value for account data setAccountData(account-here,"serial",getPlayerSerial(player-here)); and then just find all accounts with data serial and if they are more than 2 that are equal to player's serial then just cancel register, simple as that.
  10. Please, close this topic and never open it again. p.s i found different solution without using toggleControl and canceling event on fire.
  11. i know that, it's just preference. I like code better how it looks with ";" and neither way it's not incorrect. Please, don't spam this topic if you don't know how solve this issue. You're not making any point here.
  12. Why you give me same code that i wrote only differently sorted?
  13. as title says, is it possible to cancel event onClientPlayerWeaponFire or onPlayerWeaponFire ? Tried both of them to cancel with cancelEvent but didn't work. p.s: toggleControl is not solution for me, i want to play tick sound when player has 1 ammo. ( that 1 ammo would be fake bullet that ) and if i just toggle off fire control then i can't play that sound 'cause there would be no way to know when player wants to fire. Atleast i think that way. here is code what i tried with. addEventHandler("onClientPlayerWeaponFire",localPlayer,function() if (getPedTotalAmmo(localPlayer) <= 1) then cancelEvent(); end end);
  14. It does work, but how can i make that it doesn't download files from meta ? I tried deleting those meta files so they wouldn't download them but then it can't find file with downloadFile.
  15. haven't tested yet, was eating this whole time. haha
  16. lol i didn't know there is such variable as streamedin' for getlementsbytype, that will solve this problem. Thank you ! this is even better Thank you both!
  17. Ok this is what i needed, ty. But i still don't know how to check if vehicle/model is near client then only start downloading file.
  18. That sounds kinda wrong to me, isn't there easier way to do this? Also can this 'downlodFile' function download through http site?
  19. nice that's what i needed, but how can i detect if that exact object/car/item is in render distance and he has no model for it then only start downloading?
  20. as the title says, how can i make http file downloader that downloads file when they are needed in game not one after one but in exact moment when that model/file is going to be used and if client doesn't have it then downloader will download it for him?
  21. Nothing really, i just have scroll pane with images in it and if i move it little bit from bottom to top it resets instantly to the top and it's so frustrating. Here's scrolling code what i use. addEventHandler("onClientMouseWheel",GUIEditor.scrollpane[1],function(up_down) if (up_down == 1) then guiScrollPaneSetVerticalScrollPosition(GUIEditor.scrollpane[1],guiScrollPaneGetVerticalScrollPosition(GUIEditor.scrollpane[1])-4) elseif (up_down == -1) then guiScrollPaneSetVerticalScrollPosition(GUIEditor.scrollpane[1],guiScrollPaneGetVerticalScrollPosition(GUIEditor.scrollpane[1])+4) end end); Could it be this fault? But i read somewhere that it was MTA's fault in bug reports at wiki.
  22. why when you scroll scrollbar in scrollpane to up from bottom it resets back to up even if you moved it a little bit, it's almost same when you scroll down aswell. Any fix for this?
  23. What was the point writing this topic in english if that panel itself is not in english language? Also i wouldn't tell that is an admin panel, something like moderator panel would be more precise word to call your resource. It's just not enough functional for to call it as Admin Panel.
×
×
  • Create New...