Jump to content

IIYAMA

Moderators
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. When executing dx functions, it will render the result for ONE frame. In order to keep showing the result, you have to attach an addEventHandler that triggers on 'onClientRender", which will execute the code every frame.
  2. You can do it like this: local animateDXInformation = "Information" function animateDX(text) local text = animateDXInformation w1 = w1 - 10 dxDrawRectangle(w1, screenH * 0.7898, screenW * 0.1224, screenH * 0.1083, tocolor(35, 35, 35, 255), false) if(w1 < (screenW * 0.8776)) then enableDxText(text) removeEventHandler("onClientPreRender",getRootElement(),animateDX) end end addEventHandler("onClientPreRender",getRootElement(),animateDX) function dxText() local text = animateDXInformation dxDrawRectangle(screenW * 0.8776, screenH * 0.7898, screenW * 0.1224, screenH * 0.1083, tocolor(35, 35, 35, 255), false) dxDrawText("Info", screenW * 0.8953, screenH * 0.7898, screenW * 0.9807, screenH * 0.8093, tocolor(43, 155, 21, 255), 1.00, "bankgothic", "center", "center", false, true, false, false, false) dxDrawText(text, screenW * 0.8927, screenH * 0.8185, screenW * 0.9859, screenH * 0.8759, tocolor(254, 255, 255, 255), 1.25, "sans", "center", "top", false, true, false, false, false) end function enableDxText () addEventHandler("onClientPreRender",getRootElement(),dxText) setTimer(function() removeEventHandler("onClientPreRender",root,dxText) end,5000,1) end You will need to use variables outside of the function for that.
  3. IIYAMA

    [Help]

    https://stackoverflow.com/questions/19782148/lua-substitute-list-of-characters-in-string
  4. Maybe you can base it on the current gear: https://wiki.multitheftauto.com/wiki/GetVehicleCurrentGear To be honest it will be a lot of work, I personally do not recommend it unless it is a very important detail.
  5. Did you disable the entire group or just a sound of the group? bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable ) If the exact same sound is disabled(not a group of sounds) then you can not. (except if you create an overwrite of all the vehicles)
  6. You can skip the callbackArguments, unless you want to use them. dbQuery ( [ function callbackFunction, [ table callbackArguments, ] ] element databaseConnection, string query [, var param1 [, var param2 ...]] ) Keep in mind that print and iprint are not the same. Print will end up in the server window, while iprint ends up in your debug window. Everything is working fine for you?
  7. It isn't the same as what getClipboard would do, because ctrl + v is required. But it is definitely useful.
  8. There is nothing wrong with your killmessage, it works as it should be. But if you want to take vehicle kills in account then you should do some research mate. Because vehicle blow-up kills do never count as a player kill, which is just the way gta works. I do not say that it is impossible to create it, but it requires a higher scripting level. If you want this: (or) Improve your script level, make some effort yourself and do some research. Hire a paid scripter. (high level) I hope I have informed you enough about this matter.
  9. I am working with SQL, so I am not sure if the mysql resource returns the same results. But if you use iprint, it will show you the table structure as well. See this example at this page: https://wiki.multitheftauto.com/wiki/Iprint Example results: (shows also tables inside tables) [2016-10-01 21:25:43] INFO: { elem:vehicle[Monster 3]2ED3EF60, elem:vehicle[Monster 3]2ED3F620, elem:vehicle[Banshee]2ED3F548, elem:vehicle[Banshee]2ED3F590, elem:vehicle[Bullet]2ED3F5D8, elem:vehicle[BMX]2ED3FA58, elem:vehicle[BMX]2ED3FE00, elem:vehicle[Sparrow]2ED3F788, elem:vehicle[Sanchez]2ED3F6B0, elem:vehicle[Sanchez]2ED3F8A8, elem:vehicle[Sanchez]2ED3FE48, elem:vehicle[Jetmax]2ED3FC98, elem:vehicle[Dinghy]2ED3FA10, elem:vehicle[Marquis]2ED3FB78, elem:vehicle[Bandito]2ED3FAA0, elem:vehicle[Beagle]2ED3F980, elem:vehicle[Buffalo]2ED3FDB8, elem:vehicle[Sabre]2ED3F6F8, elem:vehicle[Caddy]2ED3F7D0, elem:vehicle[Sparrow]2ED3F938, elem:vehicle[Sanchez]2ED3FED8, elem:vehicle[Sanchez]2ED3FCE0, elem:vehicle[Sanchez]2ED3F860, elem:vehicle[Monster 3]2ED3F8F0, elem:vehicle[Monster 3]2ED3FC08, elem:vehicle[Buffalo]2ED3F9C8, elem:vehicle[Bandito]2ED3FAE8, elem:vehicle[Caddy]2ED3FB30, elem:vehicle[Sabre]2ED3F668, elem:vehicle[Bullet]2ED3FBC0, elem:vehicle[Banshee]2ED3FF20, elem:vehicle[Banshee]2ED3F818, elem:vehicle[Monster 3]2ED3FC50, elem:vehicle[Monster 3]2ED3FD28, elem:vehicle[Buffalo]2ED3FD70, elem:vehicle[Bandito]2ED3FE90, elem:vehicle[Caddy]2ED3F740, elem:vehicle[Sabre]2ED405E0, elem:vehicle[Bullet]2ED406B8, elem:vehicle[Banshee]2ED40748, elem:vehicle[Banshee]2ED401F0, elem:vehicle[Sanchez]2ED40508, elem:vehicle[Sanchez]2ED401A8, elem:vehicle[Sanchez]2ED40040, elem:vehicle[Sparrow]2ED40118, elem:vehicle[Sanchez]2ED40238, elem:vehicle[Sanchez]2ED3FFB0, elem:vehicle[Sanchez]2ED40598, elem:vehicle[Monster 3]2ED40550, elem:vehicle[Monster 3]2ED40700, elem:vehicle[Buffalo]2ED40280, elem:vehicle[Bandito]2ED403A0, elem:vehicle[Caddy]2ED400D0, elem:vehicle[Sabre]2ED402C8, elem:vehicle[Bullet]2ED40160, elem:vehicle[Banshee]2ED40790, elem:vehicle[Banshee]2ED40628, elem:vehicle[Sparrow]2ED3FFF8 }
  10. iprint(teststring) I am not familiar with the mysql resource, but if this is working like I think it would, use the iprint function. It will tell you exactly how the data looks like that you get back. Visible in: /debugscript 3
  11. IIYAMA

    Help

    Help first yourself... OMCow!
  12. You can ask it like this: "Can you please make an example that shows all the cars their maximum velocity?" But I am afraid this section isn't for English lessons my friend...
  13. You can't 'get' it ingame. Only 'set' it, which you can use in any other application. Clear?
  14. IIYAMA

    Little Help

    As I said before, you can't use the same code on the same application! Like my words are just trash, seriously... So split it in two: Clientside if not guiGetVisible(VipHats) then triggerServerEvent("requestOpenVIPWindow", resourceRoot) else -- close the vip window... end Serverside addEvent("requestOpenVIPWindow", true) addEventHandler("requestOpenVIPWindow", resourceRoot, function () if isElement(client) then local account = getPlayerAccount(client) if account and not isGuestAccount(account) then local accName = getAccountName(account) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "VIP") ) then triggerClientEvent(client, "openVIPWindow", resourceRoot) end end end end) Clientside addEvent("openVIPWindow", true) addEventHandler("openVIPWindow", resourceRoot, function () -- open the vip window... end)
  15. for _, vehicle in pairs(vehicles) do local originalHandling = getOriginalHandling(getElementModel(vehicle)) for _, k in pairs (originalHandling) do
  16. IIYAMA

    Little Help

    You guys can't mix clientside code with serverside code. Those are running on two different applications. One of your MTA client(clientside) and one on your server (serverside) . Client functions: https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions Server functions: https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions
  17. and instead of and image, html code?
  18. Do you have the same problem with other images of other servers?
  19. errorr = 1? Is that the reason why it doesn't work? Which server version are you running? If it is lower than 1.5.2., try to upgrade it.
  20. This is excluded the code of the previous messages. Tell me, where does the code stop working?
  21. I do not know what is wrong with it at the moment. (it is just not visible) Afaik: Make sure you grant the resource the right to use fetchRemote. Because the resource can't use this function without permission of the acl. Also this might save you some server bandwidth: Everytime you call fetchRemote, it will start downloading the data from the url. (you don't want to do that per player) fetchRemote ( 'https://d.top4top.net/p_6026au3j1.png', function (...) for k,player in ipairs(getElementsByType('player'))do savedplayers(player, ...) end end, "", false) function savedplayers(plr, img, errorr )
×
×
  • Create New...