Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. setElementPosition works pretty well, else looots of stuff everywhere would be failing.
  2. Hey guys is there a way to set a piority to dxDraw? I use already the true postGui to get over a blur effect, but an image is being distorsioned by a dxRectangle wich should be underneath. Moving it on top or under within the lua makes no effect.
  3. He said downloadFile and not latent events. He can use triggerLatentClientEvent to do that. Think before posting. Seriously feche was right.... think imo.. This will work for those working solutions which people have, but is no use for downloadFile, else show me an example.
  4. Just enable cache for the script files wich will never be more than 500kb if going crazy. luca.mtasa.com is decompilable yes, but the difficulty to do so makes it highly unlikely that someone with the knowledge to decompile is in the level of stealing stuff. (for someone in that level it'd be far easier to just do it by himself)
  5. Well as most debugs it should just give the error message in case of failure.
  6. Best option would be to save everything on resource stop and every 5min or a more realistic timer (one hour shouldnt make any issue, if you arent going to do a very unstable server).
  7. Hello guys, is there a way to check the progress of downloadFile? Greetz
  8. So i bet there's hardly anyone out there that has a perfect method for text scaling and drawing amongst all screen resolutions. (if anyone has it, please share, really.) After searching for lots of hours i decided the best way in theory is to get the pixels we are going to draw in and get the biggest scale that would fit in those pixels. The main point i found was this: https://wiki.multitheftauto.com/wiki/DxGetTextWidth My search was stomped to ask if there is a function to do what i'm looking for, wich is kind of the reverse of what this function does. A longer explanation would be something like this: local x,y = guiGetScreenSize() -- Screen size local width = x*0.05 -- Space to write in, for example, a dx rectangle local textScale = getScaleFromTextWidth( width, "Hello World") -- Get the biggest possible scale value that would fit "Hello World" in the said width addEventHandler("onClientRender", root, function() dxDrawText("Hello World", x*0.3, y*0.5, x*0.35,y*0.55, tocolor(255,255,255,255), textScale) end)
  9. Well you could just save the data both client and server side, and when the player leaves freeze the server side. (Check the reason for living with onPlayerQuit - if he leaved manually, for this purpouse it is important if it was manual rather than dropping). If he reconnects back and the difference is much more than should be, then you can assume it was manually edited and you can punish/reset him. @Anubhav - Please read the thread correctly next time. EDIT: @OP: --onPlayerQuit string quitType, string reason, element responsibleElement quitType: How the player left. This argument can be: "Unknown" "Quit" "Kicked" "Banned" "Bad Connection" "Timed out"
  10. .:HyPeX:.

    MySQL

    La solución mas fácil seria crear una base de datos en conjunto con el foro y el servidor y luego manejarte con ella, pero no es la mas fácil de configurar incialmente ni mucho menos desde la parte del foro (Sin embargo hay algunos foros que vienen con esa parte facilitada) En resumen, si quieres hacerlo bien deberias saber PHP para hacer el lado del foro, y si no, tendras que inventar alguna solucion extraña
  11. You're Welcome. PD: next time dont use google translator, go directly into the spanish sub-forum viewforum.php?f=145
  12. triggerClientEvent(thePlayer,"onTimer", thePlayer, resultado) --Client function testee(resultado) outputChatBox("Verme ="..tostring(resultado).."") removeEventHandler("onClientRender", root, tempo) addEventHandler("onClientRender", root, tempo) end addEvent("onTimer", true) addEventHandler("onTimer", getLocalPlayer(), testee) Read correctly how they work.
  13. can you show me an example? You would need to trigger onClientRender to send the image to server and then server to client. It would be a fullHD constant streaming player>server>player in a rate wich could not possible ever be achieved. You simply cant get 60FPS HD, not expect almost any player to have such a connection (Without mentioning the server cap) Just do some math. Each frame: Arround 1~1.5mb On 60 FPS - 60~90mb / sec On 32 players - 1920~2880mb / sec or 1.9~2.8GB Over 1min - 115200~172800mb or 115~172GB 1 hour - 6912~10368MB or 6912~10368 GB or 6.912~10.368 TB. It is literally insane the ammount of net traffic you're aiming.
  14. You should always write your own code, no one will help you to adapt someone's elses script to work with yours.
  15. /n alone works too, tried it already. not sure what /r does. Oh yeah, makes sense now - it was for a logging system I was working on. And since I was writing it to a text file - I had to use /r/n since that's what Windows uses. Ehm still not sure, if you're using fileWrite /n works alone too....
  16. /n alone works too, tried it already. not sure what /r does.
  17. I've been wondering with this: So far, we cannot have a system in wich the client is unnable totally to access our code, becouse the MTA needs to decrypt it to run it, but what if it did not have to decrypt it, couldnt it run it encrypted itself? Probably i'm just saying buillshit, but any clarification would be accepted
  18. .:HyPeX:.

    Money

    You're still going wrong. convertNumber is related to other stuff. You should yeah use a dxDraw, what is that it stops you from not doing so?
  19. .:HyPeX:.

    OOP

    Did you remember to enable OOP in your script?
  20. Well i think you have to replace the global blip system using exports. (I.e. create your own blip system.) Another method i think it could be getting all blips wich are created in blip system done by MTA (just thought about that now) local blips = getElementsByType("blip") You should then later on while drawing get all of its properties with all blip functions. PD: I'm unsure if it is Blip or blip, please check. https://wiki.multitheftauto.com/wiki/CreateBlip https://wiki.multitheftauto.com/wiki/Element EDIT: Yep, its "blip". Enjoy scripting! https://wiki.multitheftauto.com/wiki/Element/Blip
  21. That's becouse its measuring the ped's element rotation, not the camera rotation ^^. Its not north dot, i was just searching for a changing rotation value to test.
  22. So, just noticed checkboxes arent a gui element, are checkbox elements, and you cannot reposition them on screen with guiSetPosition (Returns error, no gui-element), so how can i move them? greetz
  23. Yeah, its not that hard, i wrote that code just now. This should draw a simulation rectangle and a blip going arround with your ped rotation. EDIT: My bad, i did some miscalculations and errors while writing down the code fully working example now. (Also fixed the function wich makes the magic, so please check. local x,y = guiGetScreenSize() local sx,sy = x*0.1,y*0.8 local cx,cy = x*0.15,y*0.85 local enx,eny = x*0.2,y*0.9 local bpwidth = x*0.01 local bpheight = y*0.01 function onMyRender() local a,b,rot = getElementRotation(getLocalPlayer()) local dx,dy = GetPositionOnRec(rot,sx,sy,cx,cy,enx,eny) dxDrawRectangle(sx,sy,enx-sx,eny-sy,tocolor(150,150,150,100)) -- Radar simulation dxDrawRectangle(dx-(bpwidth/2),dy-(bpheight/2),bpwidth,bpheight,tocolor(255,0,0,255),true) -- random blip end addEventHandler("onClientRender",root, onMyRender) function GetPositionOnRec(rot,sx,sy,cx,cy,enx,eny) local start = {sx, sy} -- Start corner of map drawn local endp = {enx,eny} -- end corner of map drawn local center = {cx, cy} -- Center of map if rot < 360 and rot > 315 then local progress = (rot - 315) / 45 sy,sx = start[2],interpolateBetween(start[1],0,0,center[1],0,0,progress,"Linear") elseif rot > 0 and rot < 45 then local progress = (rot) / 45 sy,sx = start[2],interpolateBetween(center[1],0,0,endp[1],0,0,progress,"Linear") elseif rot > 45 and rot < 90 then local progress = (rot-45) / 45 sx,sy = endp[1],interpolateBetween(start[2],0,0,center[2],0,0,progress,"Linear") elseif rot > 90 and rot < 135 then local progress = (rot-90) / 45 sx,sy = endp[1],interpolateBetween(center[2],0,0,endp[2],0,0,progress,"Linear") elseif rot > 135 and rot < 180 then local progress = (rot-135) / 45 sy,sx = endp[2],interpolateBetween(endp[1],0,0,center[1],0,0,progress,"Linear") elseif rot > 180 and rot < 225 then local progress = (rot-180) / 45 sy,sx = endp[2],interpolateBetween(center[1],0,0,start[1],0,0,progress,"Linear") elseif rot > 225 and rot < 270 then local progress = (rot-225) / 45 sx,sy = start[1],interpolateBetween(endp[2],0,0,center[2],0,0,progress,"Linear") elseif rot > 270 and rot < 315 then local progress = (rot-270) / 45 sx,sy = start[1],interpolateBetween(center[2],0,0,start[2],0,0,progress,"Linear") end local Dx,Dy = sx,sy return Dx,Dy end
  24. Well one is to obtain the vehicles or send them client-side, (wich i do not know if it would work), other is creating them client side...
  25. Um i did some math, hope it is good, probably not best solution but.... As this isnt exactly "perfect" (turning circle into rectangle) i'd check wich easing function would suit best here... i think it should work pretty good, report results. Usage: GetPositionOnRec(rot,sx,sy,cx,cy,enx,eny) rot: Rotation of your blip (Like you have the 360 angle now) sx: start corner X corner of rectangle sy: start corner Y corner of rectangle cx: center X of rectangle cy: center Y of rectangle enx: end corner X of rectangle eny: end corner Y of rectangle (Note: Start corner should be upper left and ending lower right) function GetPositionOnRec(rot,sx,sy,cx,cy,enx,eny) local start = {sx, sy} -- Start corner of map drawn local endp = {enx,eny} -- end corner of map drawn local center = {cx, cy} -- Center of map if rot < 360 and rot > 315 then local progress = (rot - 315) / 45 sy,sx = start[2],interpolateBetween(start[1],0,0,center[1],0,0,progress,"Linear") elseif rot > 0 and rot < 45 then local progress = (rot) / 45 sy,sx = start[2],interpolateBetween(center[1],0,0,endp[1],0,0,progress,"Linear") elseif rot > 45 and rot < 90 then local progress = (rot-45) / 45 sx,sy = endp[1],interpolateBetween(start[2],0,0,center[2],0,0,progress,"Linear") elseif rot > 90 and rot < 135 then local progress = (rot-90) / 45 sx,sy = endp[1],interpolateBetween(center[2],0,0,endp[2],0,0,progress,"Linear") elseif rot > 135 and rot < 180 then local progress = (rot-135) / 45 sy,sx = endp[2],interpolateBetween(endp[1],0,0,center[1],0,0,progress,"Linear") elseif rot > 180 and rot < 225 then local progress = (rot-180) / 45 sy,sx = endp[2],interpolateBetween(center[1],0,0,start[1],0,0,progress,"Linear") elseif rot > 225 and rot < 270 then local progress = (rot-225) / 45 sx,sy = start[1],interpolateBetween(endp[2],0,0,center[2],0,0,progress,"Linear") elseif rot > 270 and rot < 315 then local progress = (rot-270) / 45 sx,sy = start[1],interpolateBetween(center[2],0,0,start[2],0,0,progress,"Linear") end local Dx,Dy = sx,sy return Dx,Dy end EDIT: Readed your radar's known bug. Just set a max value to be drawn- if val > x then val = x end
×
×
  • Create New...