Jump to content

FatalTerror

Members
  • Posts

    304
  • Joined

  • Last visited

Everything posted by FatalTerror

  1. You use the Plug.DJ API to get the current song Youtube URL. After that, you convert this Youtube URL in a mp3 file and save it in your website folder. With LUA, you get this converted mp3 and you start it in your server. Now, to be more realist. Convert a Youtube Video is very slow. Convert a Youtube Video use much website ram Hope you understand.
  2. Required Arguments for playSound3D The difference between these functions is only the coordinate on the map. It wont help him to create his Plug.DJ radio. It's not too hard to understand...
  3. Plug.DJ use Youtube as music provider. If you attemp to convert a Youtube video and play it with MTA then you can make your Plug.DJ radio.
  4. I edit some stuffs in your code to make things possible. First one, I create a table containing the buttons with they position. In the render, I explore this table and create every buttons. I added a second render for the cursor, if the cursor is between the button position then, we change the image target, otherwise let the default image. Buttons = { firstButton = {x =431.50, y = 530, w = 165, h = 60, img = "button.png"}, secondButton = {x =610.50, y = 530, w = 165, h = 60, img = "button.png"}, thirdButton = {x =252.50, y = 530, w = 165, h = 60, img = "button.png"} } local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage ( 240, 145, 550, 480, "window.png" ) for i, button in pairs(Buttons)do dxDrawImage (button.x, button.y, button.w, button.h, button.img) end dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) function cursorPosition() local x, y = getCursorPosition() local x, y = x*sw, y*sh; for i, button in pairs(Buttons)do if (x >= button.x) and (y >= button.y) and (x <= (button.x+button.w)) and (y <= (button.y+button.h)) then -- Cursor is in the button button.img = "button_hover.png"; else -- Cursor isn't anymore in the button button.img = "button.png"; end end end bindKey("O", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) removeEventHandler("onClientRender", getRootElement(), cursorPosition) else isPlayerViewingPanel = true showCursor (true) addEventHandler("onClientRender", getRootElement(), cursorPosition) end end )
  5. What are you trying to do? Maybe this could help you? https://wiki.multitheftauto.com/wiki/RGBToHex
  6. Well, the script should work... I put some comments in the code. addEventHandler("onPlayerDamage", getRootElement(), function(attacker, weapon, body, loss) if not (attacker == source) then local attackAccount = getPlayerAccount(attacker) local sourceAccount = getPlayerAccount(source) if not isGuestAccount(sourceAccount) then if not isGuestAccount(attackAccount) then setAccountData(attackAccount, "antideslog", false) setTimer(function() for i, v in ipairs(getElementsByType("player"))do -- check if the player still connected in the server if v == attacker then setAccountData(attackAccount, "antideslog", true) -- The attacker is not in combat anymore after 1 min end end end, 60000, 1) end setAccountData(sourceAccount, "antideslog", false) setTimer(function() for i, v in ipairs(getElementsByType("player"))do -- check if the player still connected in the server if v == source then setAccountData(sourceAccount, "antideslog", true) -- The player who receive the shot is not in combat anymore after 1 min end end end, 60000, 1) end -- They are now in combat. end end) addEventHandler("onPlayerLogin", getRootElement(), function(previous, current, autologin) if current then local data = getAccountData(current, "antideslog") if (data == true) then -- ok, he can play elseif(data == false)then -- ban the player setAccountData(current, "antideslog", true) banPlayer(source) else end end end)
  7. Insults = { ['shit'] = 'caca', ['fuck'] = 'love', ['bitch'] = 'miss', ['gay'] = 'nice man' } addEventHandler("onPlayerChat", getRootElement(), function(message, type) if message and (type == 0) then for i, w in pairs(Insults)do if string.find(message, i) then cancelEvent() local message = string.gsub(message, i, w) outputChatBox(getPlayerName(source)..":#FFFFFF "..message, getRootElement(), 255, 255, 255, true) end end end end)
  8. I've never seen that before for a GUI and I hardly think it's possible. Anyway, I think he can create a kind of "background" behind the ped using dxDrawMaterialLine3D.
  9. If I understood your topic, a dxDrawInput doesn't exist. If you want your own input system, you should create it by youself. Theses functions maybe will help you: dxDrawRectangle dxDrawText addEventHandler("onClientClick") addEventHandler("onClientKey") addEventHandler("onClientCharacter")
  10. I think I understand what you are looking for: addEventHandler("onPlayerDamage", getRootElement(), function(attacker, weapon, body, loss) if (attacker ~= source) then local attackAccount = getPlayerAccount(attacker) local sourceAccount = getPlayerAccount(source) if not isGuestAccount(attackAccount) then if not isGuestAccount(sourceAccount) then setAccountData(attackAccount, "antideslog", false) setTimer(function() for i, v in ipairs(getElementsByType("player"))do if v == attacker then setAccountData(attackAccount, "antideslog", true) end end end, 60000, 1) end setAccountData(sourceAccount, "antideslog", false) setTimer(function() for i, v in ipairs(getElementsByType("player"))do if v == source then setAccountData(sourceAccount, "antideslog", true) end end end, 60000, 1) end end end) addEventHandler("onPlayerLogin", getRootElement(), function(previous, current, autologin) if current then local data = getAccountData(current, "antideslog") if (data == true) then -- ok, he can play elseif(data == false)then -- ban the player setAccountData(current, "antideslog", true) banPlayer(source) else end end end)
  11. @Steve: This should work. addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for i, v in ipairs(getElementsByType("vehicle"))do setVehicleFuelTankExplodable (v, true ) end end)
  12. FatalTerror

    Avast errors

    Hi there ! Today, something happends for the first time. The Antivirus Avast detect the updata requests to the web as a unsafe for the PC. I don't know if it's normal but It was never done before for me. That alert is made everytime that MTA:SA try to contact one of your domain. Another thing, everytime I try to access to any domain from mtasa.com or multitheftauto.com, Avast blocks the page and don't execute it. I have this alert only without the SSL certificate. When I try with https, it works perfectly. Hope someone can help me.
  13. Another dirty solution is using onElementDataChange When you setElementDimension, you set at the same time an element data to the player. That could work no?
  14. I thought not use this solution, they should make a getServerIP function. That would be more easy. But thanks anyway.
  15. Hi there, I want to know why we don't have a function to get the current server IP ? I'm searching about it for weeks and I can't found it. The only think i found is that function: getServerConfigSetting ( string name ) but some servers don't specifie they IP on the tags. If you know why we don't have a getServerIP and you know an alternative that would be useful. Thanks for your help. FatalTerror.
  16. local isChatVisible = true function chat ( key, keyState ) if isChatVisible then showChat ( false ) isChatVisible = false else showChat ( true ) isChatVisible = true end end bindKey ( "f1", "down", chat )
  17. FatalTerror

    E-mail

    Actually, my mail script is using my own website. I think it still working. But if you want to use your own website it would work. Just make sure that your host accept the mail() PHP function.
  18. Not really ^^ Per example, he is dancing. When the player press the right button to aim, the dancing animation stop. I don't know if it's possible to let the animation while the player aim.
  19. That's not the goal. I've set an animation to the player like.. dancing. I want, when the player aim someone he continue to dancing. Hope you understand.
  20. Hi, I'm just searching how to enable the player aim but with the current animation. Is it possible? When the user press the right button to aim, the animation stop. Thanks alot.
  21. He returns that: outputDebugString("CLIENT DONE") I put that for test.
  22. Okay, this time the loadstring don't want execute it -- client script local file = fileOpen (":"..mapToLoad.."/"..xmlNodeGetAttribute (node, "src"), true); local fileContent = ""; if file then local buffer; while not fileIsEOF(file)do buffer = fileRead(file, fileGetSize(file)) fileContent = fileContent..buffer; end fileClose(file); triggerClientEvent("doLoadStringClientSide", getRootElement(), fileContent) end addEvent("doLoadStringClientSide", true); addEventHandler("doLoadStringClientSide", getRootElement(), function(fileText) if fileText then outputConsole(fileText); loadstring(fileText)(); else outputDebugString("Something went wrong...", 1); end triggerEvent("onClientResourceStart", getResourceRootElement(getThisResource())) end) loadstring work in client-side? Nothing happens.
  23. Oh well, that's right... If I open the file in server side and I load it in client-side. That could work? no? Otherwise, exist an function to force the download?
×
×
  • Create New...