Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. Bump, cant make this work..
  2. Well, im pretty sure you should search for the txd id you have to replace, thats all.
  3. Thanks!, i'll check out later it it works
  4. well i cant spawn them, not even setting them streamable or anything. PedTDM = createPed(0,502.93051147461, -10.852199554443,1000.6799926758,126.002746) setElementInterior(PedTDM, 17) setElementStreamable(PedTDM, false) setElementPosition(PedTDM,502.93051147461, -10.852199554443,1000.6799926758) setElementData(PedTDM, "text","Team Deathmatch") setPedAnimation(PedTDM, "DANCING","dnce_M_a", 1000, true,false) PedM = createPed(0,481.27551269531, -19.967199325562,1000.6799926758,355.002746) setElementStreamable(PedTDM, false) setPedAnimation(PedM, "DANCING","dnce_M_a", 1000, true,false) setElementInterior(PedM, 17) setElementData(PedM, "text", "Missions | Co-Op") setElementPosition(PedM, 481.27551269531, -19.967199325562,1000.6799926758)
  5. Yes, everything works perfectly (i get the total scores client-side displayed), but announce is kinda not working.
  6. Not really, it will only unbind it IF it is bound, and it will only bind it IF it is unbound (Note that dist is distance to a ped) Fixed it by removing the "F" Thingy on the getKeyBound.. Thanks Anyways HyPeX
  7. Well the key wasnt unbided.. i can always press it.. if dist <= 5 then if not getKeyBoundToFunction(ShowJoin) then bindKey("F", "down", ShowJoin) end local scx2, scy2 = getScreenFromWorldPosition ( PedX, PedY, PedZ + 1, -50, true ) local alpha2 = 255 dxDrawText ( "#66ffaaPress #ffffffF #66ffaaTo join", scx2, scy2, scx2, scy2, tocolor ( r, g, b, alpha2 ), MyScale, font, "center", "center",false,false,false,true ) else if getKeyBoundToFunction(ShowJoin) == "F" then unbindKey("F","down",ShowJoin) end end
  8. I made it quickly based on what is put on the MTA Wiki. You can change it however you wish. I'm just showing you a example you could use to build your own. if you read carefully, i wanted the maths part, not the script imo. (even the topic name says so)
  9. Game-state doesnt recognize player's score, help? Score setting: function CountScores() local ATeam = getTeamFromName(TeamA) local BTeam = getTeamFromName(TeamB) local APlayers = getPlayersInTeam(ATeam) local BPlayers = getPlayersInTeam(BTeam) ScoreAPoints = 0 ScoreBPoints = 0 Winner = nil for i, v in ipairs(APlayers) do if not getElementData(v,"Kills") then setElementData(v, "Kills", 0) end Kills = getElementData(v, "Kills") setPlayerAnnounceValue(v, "Score", Kills * 100) ScoreAPoints = ScoreAPoints + getElementData(v, "Kills") setElementData(v, "Score", Kills * 100) end for i, v in ipairs(BPlayers) do if not getElementData(v,"Kills") then setElementData(v, "Kills", 0) end Kills = getElementData(v, "Kills") setPlayerAnnounceValue(v, "Score", Kills * 100) setElementData(v, "Score", Kills * 100) ScoreBPoints = ScoreBPoints + getElementData(v, "Kills") end if ScoreAPoints > ScoreBPoints then Winner = ATeam elseif ScoreBPoints > ScoreAPoints then Winner = BTeam end return Winner, ScoreAPoints, ScoreBPoints end function CountCurrent() local Winner, TeamAPoints, TeamBPoints = CountScores() triggerClientEvent("SetCurrent", getRootElement(), TeamAPoints, TeamBPoints) end timer = setTimer(CountCurrent, 1000, 0)
  10. Just make the screen turn red when you're on low health function addRednessOnDamage ( ) local playerHealth = getElementHealth ( source ) local theVehicle = getPedOccupiedVehicle(source) if playerHealth<=20 then fadeCamera ( source, false, 2.5, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCamera2, 900, 1, source ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal else fadeCamera ( source, false, 2.5, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCameraDelayed, 500, 1, source ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal end end addEventHandler ( "onPlayerDamage", getRootElement(), addRednessOnDamage ) function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running. if (isElement(player)) then fadeCamera(player, true, 1.0) end end function fadeCamera2(player) if (isElement(player)) then fadeCamera(player, true, 20.0) end end Pretty much unuseful if you're being spammed with an M4..
  11. Note that you cant actually make it with one value for all resolutions: i did this and its still not perfect.. so deal with it like that.. (What most varies on a text drawing is scale) if x >= 1025 and y >= 720 then dxDrawText(health, x/1.135, y/1.322, x/1, y/1, tocolor(255,255,255,180), 0.43, PodiumFont2, center, center, false,false,true,true) elseif x == 1024 and y == 768 then dxDrawText(health, x/1.135, y/1.322, x/1, y/1, tocolor(255,255,255,180), 0.4, PodiumFont2, center, center, false,false,true,true) elseif x == 800 and y == 600 then dxDrawText(health, x/1.135, y/1.322, x/1, y/1, tocolor(255,255,255,180), 0.3, PodiumFont2, center, center, false,false,true,true) elseif x == 640 and y == 480 then dxDrawText(health, x/1.135, y/1.321, x/1, y/1, tocolor(255,255,255,180), 0.25, PodiumFont2, center, center, false,false,true,true) end
  12. I've Checked interpolateBetween's Examples but Really long and didn't understand them well, could you give an simple example ? please. inerpolateBetween is kind of an advanced function... This is what I use in my login though: local intData = { start = { 0, 0 }, _end = { 485, 231 }, startTime = nil, endTime = nil, alpha = 0 } -- this is in onClientRender if not intData.startTime then intData.startTime = getTickCount ( ) intData.endTime = getTickCount ( ) + 1500 intData.isDone = false end if ( isOpen ) then local now = getTickCount ( ) local elapsedTime = now - intData.startTime local duration = intData.endTime - intData.startTime local progress = elapsedTime / duration local start = intData.start local _end = intData._end local w, h, _ = interpolateBetween ( start[1], start[2], 0, _end[1], _end[2], 0, progress, "OutBounce" ) and to make the shadow when the cursor is over DX text, you can use: getCursorPosition check the x and y axis, and if it's in the text, then draw a dx text in the background, behind the current text. https://community.multitheftauto.com/index.php?p= ... ls&id=7970 -> This resource may help you Not really with some decent idea and pacience: lets explain him this way (how i did with my friend who started lua short time ago) Interpolate gives a number wich is in a point between your values selected (1, 2, 3) specified by progress, in a curve or "Way" its defined (usually "Linear" is pretty self expainatory) Note: Progress is from 0 to 1 (0.5 = 50%) So; local Val1, Val2, Val3 = interPolateBetween(BaseVal1, BaseVal2, BaseVal3, EndVal1, EndVal2, EndVal3, Progress, "Linear") Supposing BaseVal1 is 0 and EndVal1 is 100 then a progress of 0.5 will return Val1 = 50. Normally onClientRender is used inside interpolate funcions to make them smooth, i lastly combined it with timers, works pretty well. (thought this might be a bit more advanced and complicated, it works pretty well, it is taken from my 3D text function for my gamemode). Note: This makes the text "Flash" like a heart meter (bigger, smaller, bigger, etc) and some variables are not present becouse its just a part of it) InterTimer = setTimer(function() if val1 == 50 then val1 = 100 val2 = 50 else val1 = 50 val2 = 100 end end, 500, 0) function DrawRender() local rem, asd, asd2 = getTimerDetails(InterTimer) local p = rem / 500 local v1,v2,v3 = interpolateBetween(val1, 0,0, val2, 0,0, p, "Linear") local MyScale = ( v1 / 100 ) * 1.3 local scx2, scy2 = getScreenFromWorldPosition ( PedX, PedY, PedZ + 1, -50, true ) local alpha2 = 255 dxDrawText ( "#66ffaaPress #ffffffF #66ffaaTo join", scx2, scy2, scx2, scy2, tocolor ( r, g, b, alpha2 ), MyScale, font, "center", "center",false,false,false,true ) addEventHandler("onClientRender", getRootElement(), DrawRender)
  13. it should never get greater than 100, (my script stops it at 99.9)
  14. Just make the screen turn red when you're on low health
  15. Hey guys, who can help me work this thingy out? I want to display health(0-100) to R(0-255) but inverted, (like 100 = 0) Basically i did this, but idk how to invert it. local health = getElementHealth(player) local health = math.floor((health)/1) local health = math.ceil(health) local health = health / 100 local health = health * 255 Ths makes that at 100% health, the R will be 255, how can i make it the other way arround?
  16. If ur pulling that off, then ur on a level that you woud'be rather hacking big companies than small mta scripts.
  17. I'm using visualiser resource as core, so i know whenever its working or not
  18. As i've posted and couldnt get re-answered this might look like an idea to protect client-side stuff... not sure if viable thought
  19. Yeah, but it says the radio name wich is chillout dreams and just that, nothing else.
  20. Hey guys, how can i create a PlaySound3D with any Stream radio? i know direct link like IP is supported and works but.. it doenst display all the stuff like author, etc. i wanted to make this PLS work: [playlist] NumberOfEntries=8 File1=http://pub5.di.fm:80/di_chilloutdreams Title1=Digitally Imported - Chillout Dreams Length1=-1 File2=http://pub3.di.fm:80/di_chilloutdreams Title2=Digitally Imported - Chillout Dreams Length2=-1 File3=http://pub8.di.fm:80/di_chilloutdreams Title3=Digitally Imported - Chillout Dreams Length3=-1 File4=http://pub1.di.fm:80/di_chilloutdreams Title4=Digitally Imported - Chillout Dreams Length4=-1 File5=http://pub7.di.fm:80/di_chilloutdreams Title5=Digitally Imported - Chillout Dreams Length5=-1 File6=http://pub6.di.fm:80/di_chilloutdreams Title6=Digitally Imported - Chillout Dreams Length6=-1 File7=http://pub2.di.fm:80/di_chilloutdreams Title7=Digitally Imported - Chillout Dreams Length7=-1 File8=http://pub4.di.fm:80/di_chilloutdreams Title8=Digitally Imported - Chillout Dreams Length8=-1 Version=2
  21. I agree with you, its just not about stealing, how are we supposed to ever be capable of doing this ourselves or getting the knowledge for doing it and creating a method in the future (if ever needed, like denny needs it for school), since i myself couldnt find any useful topic about it in the internet (spent about 2 hours just passing pages to find anything, but couldnt), and here comes, im a foolish for actually asking when i couldnt find it myself, just for the fact of asking someone who knows it and can explain it in a better way?
  22. So came in with the idea, could i generate a copy of RSA Keys in the game? (Lets say that the script has my stuff encrypted in my own way lets say A is represented as MM, and that upon working it sends the stuff to another script wich is server-side only with an exported function wich descrypts and sends back MM into A, as supponsing like: Script = exports.etc). Could it be possible to call that return as a function itself or how could i do it? this is of course, talking about a client side script, since the call function is client and server side, the client would only have access to my code wich would look like rubbish stuff with an export to a resource they will never have download or access to in any way. Thanks in Advance HyPeX
  23. Hey guys, How could i take a RSA Key (Public/Private) into action to compile/encrypt my scripts and protect them? Lets say: how can i duplicate the github codeline into lua supposed for: openssl -rsautl -in text.txt -encrypt -inkey ~/.ssh/id_rsa.pub.pem -out crpy.txt wich would turn this Hello ShitHeads! into this DãZ·Ù² ØÚÙxb£z‘Îì:·àƒŸ¨ð6…eƒìRy…;×4'€|lŽlE P‚`so¯Å´¦V“O~Z@@6åí ¬Ï½Lf 2U®k@DÊBWlø²]Ò—l.w ô‚^ Ši?¿žð£ÞÚ̪ô¡d²!pC‹Œ:¼>ÞŠVW•PB÷WÓ¤ªgÌ G\ú`™[ŸGüã’³Úóùú‡]ÁÒz;Q/Z=©Oöž|†¦U#A¹¤µ aD<à;¤r[õºo]?›Âà \Ü%LJ‹AÇ õNúdþ1ã¨RáËÁ$LþBõc]Ÿ ^Mb…c”#Ù Thanks in advance HyPeX PD: (I already got the RSA Keys and know how to encrypt / decrypt txt files with openssl)
  24. That's true of cause. But I'd rather have my scripts compiled for a few other reasons. e.g. my current build system which couldn't work with the Online compiler. Also I don't want to make it too easy for people looking a my scripts. To clarify on my build system: I bascially have a small program which compiles my entire script into three files. shared.luac, server.luac and client.luac. This compilation process happens every 3 seconds in order to always have the newest changes upon a resource restart. This also allows me to watch compilation errors (e.g. missing braces) without switching to MTA. That also helps quite well against script stealers, since they'd only end up with one giant scriptfile. Right now I just removed the warning messages from my server since they're just plain useless, but once the warning about a "bad" compiler is no longer a warning I'll be unable to compile files for other clients. And there's still the question: Why break something which works perfectly well right now? A good rule for this is: Be creative! IDA Pro and OllyDBG are usually my tools of choice when reversing Applications. They take a long time to get into, but once you understand them they're extremely useful. How I'm decrypting the scripts shall stay a secret for now. But I could say two words and most people in this thread would be able to create a decrypter in just a matter of minutes. I'd like to know the two words for rather creating my own encryption, how could i do this? (I just know lua and nothing more)
×
×
  • Create New...