Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. But there is no way to do this? No.
  2. I'm just reading over, but, if you make a value to go up (0 -> 1) for interpolate, how ur expecting to do the way arround (1 -> 0) with the same code?
  3. Just to made clear, why u actually think MySQL is better? its not worth the cost if you do not really need it, as it means alot more in hosting.
  4. NOOOOOOOOOOO - Do you read?!!!! THE dxDrawText function needs to be inside the onClientRender!! addEventHandler("onClientRender", getRootElement(), function) removeEventHandler("onClientRender", getRootElement(), function) and by the way: getPlayerCount() or in your case: local number = #players
  5. You need to call this function every time with onClientRender, please read the wiki. https://wiki.multitheftauto.com/wiki/DxDrawText addEventHandler("onClientRender", getRootElement(), YourFunctionName)
  6. .:HyPeX:.

    help

    When you did killped (zombie) it dies.. how it can not be dead? you may say that it does not dissapear...? try with this: destroyElement ( element elementToDestroy ) Maybe...? function killzombieinwater ( ) local zombie = getElementData ( source, "zombie" ) if isElementInWater ( zombie ) then killPed ( zombie ) destroyElement( zombie ) end end addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, killzombieinwater )
  7. Did you even bother to read the replies? If you had, you would have seen that KRZO said this. i did, he said underwater, i said invisible, you seriously need to get some glasses on.
  8. You can create an invisible object and then walk over it..
  9. Errors on all the lines with any XML functions.. only the creating lines are okay.
  10. .:HyPeX:.

    DxDraw

    Example based on johny-s idea Saving: local x = LevelNumber setElementData(player, "Level", x) Setting image local imageTable = {level0 = "file.png", level1 = "file.png", level2 = "file.png"} local playerLevel = getElementData(player, "Level") local filename = imageTable["level"..playerLevel] setElementData ( source, "Rankicon", ":Class\\Rank\\rank_"..filename..".png" )
  11. Yes, but if i'm saving it and loading it client-side it should be able to be loaded by the client.
  12. Kinda forgot that point, but it should still work...
  13. Bump, someone? i'm struck at making this work
  14. Hello, i'm starting up XML to save radios within a player's serial. and i'm kinda trapped.. cant make it work.. i get errors all the way down. if xmlLoadFile("Radios.xml") then else xmlCreateFile("Radios.xml", "Players") end function asd() local serial = ""..getPlayerSerial(getLocalPlayer()).."" local radios = xmlLoadFile("Radios.xml") if not xmlFindChild(radios, serial, 0) then serialPlayer = xmlCreateChild(radios, serial) end if not xmlFindChild(serialPlayer, "Stations", 0) then stations = xmlCreateChild(serialPlayer, "Stations") end if not xmlNodeGetChildren("Stations") then station = xmlCreateChild("Stations", "0") xmlNodeSetAttribute("0", "Name", text) xmlNodeSetAttribute("0", "Link", text2) else local node = xmlNodeGetChildren(stations) local node2 = #node local node3 = node2 + 1 local stationQuantity = ""..node3.."" station = xmlCreateChild("Stations", stationQuantity) xmlNodeSetAttribute(station, "Name", text) xmlNodeSetAttribute(station, "Link", text2) end end
  15. Not sure if got it right, but nothing happens function muteOtherStreams(success, length, streamName) if source == radio then return end if(guiCheckBoxGetSelected(RadioMuteCheckBox) == true) then if CurrentRadio then if(source ~= nil) and (source ~= CurrentRadio) then stopSound(source) if(guiCheckBoxGetSelected(RadioOutputMuteCheckBox) == true) then outputChatBox("#00aaff[Radio]: #841FFFAnother Stream was stopped!", 255, 255, 255, true) end end end else if not CurrentRadio then if(source ~= nil) and (source ~= CurrentRadio) then if(guiCheckBoxGetSelected(RadioCustomVolume) == true) then RadioVolumeGet = guiGetText( RadioVolumeEditBox ) RadioVolume = string.gsub(RadioVolumeGet, "[^123456789]", "") setSoundVolume(source, RadioVolume) end end else if (source ~= nil) and (source == CurrentRadio) then if(guiCheckBoxGetSelected(RadioCustomVolume) == true) then RadioVolumeGet = guiGetText( RadioVolumeEditBox ) RadioVolume = string.gsub(RadioVolumeGet, "[^123456789]", "") setSoundVolume(source, RadioVolume) end end end end end addEventHandler("onClientSoundStream", getRootElement(), muteOtherStreams)
  16. Hello, if i'm making server radio, where maps play their own song, how can i search it and kill it when the radio is on? Thanks HyPeX
  17. It should draw a window with 2 blue lines in the bottom part of the screen with a text winner: default and an undertext streak: (1) when using the command /win, but nothing happens. Any idea anyone? local x,y = guiGetScreenSize() local announce = "default" local Streak = "1" announce = "default" Streak = "1" function setStreak(streak) Streak = streak end addEvent("setStreak", true) addEventHandler("setStreak", getRootElement(), setStreak) function setAnnounce(text) announce = text end addEvent("setAnnounce", true) addEventHandler("setAnnounce", getRootElement(), setAnnounce) function announce() executeCommandHandler ("win", localplayer) end addEvent("announce", true) addEventHandler("announce", getRootElement(), announce) local Dx_Rec = nil addCommandHandler("win", function () if Dx_Rec then return end Dx_Rec = {} Dx_Rec.startTime = getTickCount() Dx_Rec.endTime = Dx_Rec.startTime + 2000 Dx_Rec.easingFunction = "InQuad" addEventHandler("onClientRender", getLocalPlayer(), drawStuff) end) function drawStuff() local x,y = guiGetScreenSize() local now = getTickCount() local elapsedTime = now - Dx_Rec.startTime local duration = Dx_Rec.endTime - Dx_Rec.startTime local progress = elapsedTime / duration local fAnimationTime = getEasingValue(progress, Dx_Rec.easingFunction) local alpha = fAnimationTime*200 local alphal = alpha/1.2 dxDrawRectangle ( 0, y/1.4, x, y, tocolor ( 0, 0, 0, alpha ) ) dxDrawText ( "Winner: #ffffff " .. announce, 0, y/1.3, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawText ( "Streak: #00aaff( #ffffffx" .. Streak .." #00aaff)", 0, y/1.15, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawLine ( 0, y/1.02, x, y/1.02, tocolor ( 0, 170, 255, alphal ), 15 ) dxDrawLine ( 0, y/1.4, x, y/1.4, tocolor ( 0, 170, 255, alphal ), 15 ) if now > Dx_Rec.endTime then removeEventHandler("onClientRender", getRootElement(), drawStuff) addEventHandler("onClientRender", getRootElement(), Paused) Pause = setTimer(function() removeEventHandler("onClientRender", getLocalPlayer(), Paused) Dx_Rec.startTime = getTickCount() Dx_Rec.endTime = Dx_Rec.startTime + 4000 Dx_Rec.easingFunction = "OutQuad" --Fast at first then decelerating addEventHandler("onClientRender", getLocalPlayer(), UndrawStuff) end, 5000, 1) end end function Paused() dxDrawRectangle ( 0, y/1.4, x, y, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( "Winner: #ffffff " .. announce, 0, y/1.3, x, y, tocolor ( 0, 170, 200, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawText ( "Streak: #00aaff(#ffffff x" .. Streak .." #00aaff)", 0, y/1.15, x, y, tocolor ( 0, 170, 255, 200 ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawLine ( 0, y/1.02, x, y/1.02, tocolor ( 0, 170, 255, 166 ), 15 ) dxDrawLine ( 0, y/1.4, x, y/1.4, tocolor ( 0, 170, 255, 166 ), 15 ) end function UndrawStuff() local x,y = guiGetScreenSize() local now = getTickCount() local elapsedTime = now - Dx_Rec.startTime local duration = Dx_Rec.endTime - Dx_Rec.startTime local progress = elapsedTime / duration local fAnimationTime = getEasingValue(progress, Dx_Rec.easingFunction) local alpha = (1-fAnimationTime)*200 local alphal = alpha/1.2 dxDrawRectangle ( 0, y/1.4, x, y, tocolor ( 0, 0, 0, alpha ) ) dxDrawText ( "Winner: #ffffff " .. announce, 0, y/1.3, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawText ( "Streak: #00aaff(#ffffff x" .. Streak .." #00aaff)", 0, y/1.15, x, y, tocolor ( 0, 170, 255, alpha ), 1.3, "bankgothic", "center","top",nil,nil,nil, true, true ) dxDrawLine ( 0, y/1.02, x, y/1.02, tocolor ( 0, 170, 255, alphal ), 15 ) dxDrawLine ( 0, y/1.4, x, y/1.4, tocolor ( 0, 170, 255, alphal ), 15 ) if now > Dx_Rec.endTime - 200 then removeEventHandler("onClientRender", getLocalPlayer(), UndrawStuff) Dx_Rec = nil end end
  18. I'm sorry, but i dont see this funcion on usage at all here, its just the name of the function. function dxDrawAnimWindow(text,alto,ancho,color,font,anim) local x,y = guiGetScreenSize() btAncho = ancho btAlto = alto/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btAncho, btAlto, btAlto/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2,font,"center","center") end As far as i'm concerned, i should paste this on client and call it.. i dont really see the the usage of bool dxDrawAnimWindow ( string text, int alto, int ancho, int color, string element font, string anim) EDT//: On none of the examples we can see onClientRender / onClientPreRender, so i dont know how this is going to work..
  19. .:HyPeX:.

    DirectX

    Hello, is it possible to run MTA on DirectX 10/9? becouse my GPU doesnt support DX11, althought it worked, now it is broken and crashes when running DX11. Thanks HyPeX PD: ik this becouse i did a test both on DX9 and DX11, on DX9 worked fine whereas DX11 made the screen simply shatter and freeze.
  20. function cancelarEvento (thePlayer) cancelEvent() outputChatBox ( "Você abandonou o evento!", thePlayer, 255, 0, 0, true ) setElementDimension(thePlayer,0) end addCommandHandler ( "abandonar", cancelarEvento ) funcoes is not an event, it is a function. You should check how events work and what cancelevent does. Use it single like this to cancel the current thing it is triggered on (this case /abandonar). Notice that this will only cancel this function and not others, if they are triggered the same. And Aalso notice that cancelEvent has to be triggered on any time to cancel it, else it will only cancel it once.
  21. i said this just to notice that this should be done carefully on a limited bandswith server, or a server with too many players can cause problems of lag. Notice that one thing is a radio that its a stream and not so big bandwith-consuming and another thing is a youtube video.
  22. Guys, you're missing a heavy part here, you can actually download this, but you will need to do it client-sided wich is literally impossible, becouse either it would be using server's network to download the music wich it aint good..
  23. Just read a little arround on the functions https://wiki.multitheftauto.com/wiki/Weapon
  24. Not directly, but you can stop him from having one.
×
×
  • Create New...