Jump to content

koragg

Members
  • Posts

    730
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by koragg

  1. @JeViCo it's not really my function, just used the resource how it was when I downloaded it. Don't wanna touch it if it works ok as it is Only wanna create the animation I mentioned.
  2. Hello guys, I have the below script which creates a small notification at the top center of the screen. I added a /showmsg command for testing purposes. If I type /showmsg once and then after 1 second type it again the new notification would go below the previous one with a little animation. But the problem is that when the first notification disappears, the second just switches places with it with no animation at all. I'd like to have a smooth animation transition for the second notification when the first notification disappears and the second takes its place. If you test it out yourself you'll see what I mean. --triggerClientEvent(source, "addNotification", root, "text", 2) --1=success, 2=warning, 3=error local x, y = guiGetScreenSize() local sx, sy = x/1440, y/900 local notifications = {} ------------------------------------------------------------------------------------------------------------------------- addEvent("addNotification", true) function outputNotification(text, level) if type(text) == "string" and text ~= "" and type(level) == "number" then local image = "images/succes.png" if level == 1 then image = "images/succes.png" elseif level == 2 then image = "images/warn.png" elseif level == 3 then image = "images/error.png" end table.insert(notifications, {text = text, level = image, tick = getTickCount(), animPos = {0,0}, state = "up"}) return true else outputDebugString("outputNotification: Bad arg",3,255,0,0) return false end end addEventHandler("addNotification", root, outputNotification) ------------------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", root, function() for id, notif in ipairs(notifications) do if id == 1 and #notifications >= 7 then notif.tick = getTickCount() notif.state = "down" end if notif.state == "up" then notif.animPos[1], notif.animPos[2] = interpolateBetween(0,0,0,1,1,0,getProgress(750,notif.tick),"InOutQuad") if notif.animPos[1] == 1 then notif.tick = getTickCount() notif.state = "idle" end end if notif.state == "idle" then if notif.tick + (5*1000) <= getTickCount() then notif.tick = getTickCount() notif.state = "down" end end if notif.state == "down" then notif.animPos[2] = interpolateBetween(1,0,0,0,0,0,getProgress(750,notif.tick),"InOutQuad") if notif.animPos[2] == 0 then table.remove(notifications, id) return end end dxDrawRectangle(x*0.439583, y*0.064815+((y*0.04167*(id-1))*notif.animPos[1]), x*0.11979167, y*0.037, tocolor(20,20,20,255*notif.animPos[2]), true) dxDrawImage(x*0.4421875, y*0.06852+((y*0.04167*(id-1))*notif.animPos[1]), x*0.0167, y*0.03, notif.level, 0, 0, 0, tocolor(255,255,255,255*notif.animPos[2]), true) dxDrawShadowText(notif.text, x*0.4640625, y*0.064815+((y*0.04167*(id-1))*notif.animPos[1]), x*0.090104167, y*0.037, tocolor(255,255,255,255*notif.animPos[2]), 0.93*sy, "default-bold", "left", "center", true, true, true, true, false) end end, true, "low-9") ------------------------------------------------------------------------------------------------------------------------- function getProgress(addtick, tick) local now = getTickCount() local elapsedTime = now - tick local duration = tick+addtick - tick local progress = elapsedTime / duration return progress end ------------------------------------------------------------------------------------------------------------------------- function dxDrawShadowText(text, x, y, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning) width = x+width height = y+height local alpha = string.format("%08X", color):sub(1,2) dxDrawText(text:gsub("#%x%x%x%x%x%x", ""), x, y+scale, width, height, tocolor(getColorFromString("#000000"..alpha)), scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning) dxDrawText(text, x, y, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning) end ------------------------------------------------------------------------------------------------------------------------- function testing() triggerEvent("addNotification", localPlayer, "text", 2) end addCommandHandler("showmsg", testing) And since the notification has images too here's the whole resource: https://mega.nz/file/1tgACYBa#Z-etw39cdYNrp-gk7lTasSlfUlrM-rL0IweYbLbHhbA I'm really bad with interpolateBetween and would be very thankful if someone can make it show a transition when a previous notification vanishes and the next one after it takes its place.
  3. Try like this maybe? guiGridListGetItemText(giveWindowGridlist,guiGridListGetSelectedItem(giveWindowGridlist)) As guiGridListGetItemText accepts 3 arguments which are gridList, rowIndex and columnIndex but the function guiGridListGetSelectedItem returns two things according to MTA wiki: Returns the row and column indexes of the selected item Not sure but play around with it as it's hard to guess what's wrong as I can't test it myself. Though if this is the case I'm not sure why the first one works fine for the Translated variable.
  4. You have for i,v in pairs(shop_items) do on line 5. The 'v' letter or variable represents an element from the 'shop_items' list. Maybe that element is an array so you have to access its members by doing v[1], v[2], etc. Try to use outputChatBox(v[2]) and see what appears in the chat. Same for v[1] and v[2]. Here's an example: You have a list of PC parts called 'shop_items'. Each part from the list is marked with the letter 'v'. Every PC part has a model number, name, manufacturer, etc. So if the first information is the name of the part you simply write v[1] and you get the name of the PC part. If you want the model number, you type v[2] and if you want the manufacturer you type v[3] and so on.
  5. Won't it be better to use one of these mods instead of using shaders? https://community.multitheftauto.com/index.php?p=resources&s=list&name=signal&descr=&category=
  6. Try a browser like this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11963
  7. Hey, quick search found this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10065 Give it a go and if not working search for 'youtube' keyword to find other resources which may work.
  8. I've had a bug where if I have a vehicle paintjob set on one server and enter another, the one from the first server is still applied. Only fix was to restart client as well. Btw I don't think it matters if the resources are in a seperate folder or not. If they're named the same then they will overlap with other servers' ones. You can see in MTA San Andreas\mods\deathmatch\resources folder that just the resources get downloaded, not the whole folder they're in. I renamed all resources at my server by adding a prefix to them. This not only solves such overlap problems but also means that once players download my stuff the first time, they won't have to ever do so again as when they enter other servers the scripts won't get overwritten.
  9. Just updated it and it should work perfect now
  10. It's funny how easy this was now after having learned JavaScript, HTML and CSS along with SQL more intensively for the past year. Made a working script for a few hours and finished it in a few days. Here's my web toptimes viewer: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18065
  11. That explains everything. Thanks for the help everyone Even though it won't work as I want to I learned how to do it server-side if I ever need to. Ended up using another car which has double exhausts by default.
  12. I also tried setting it server-side but doesn't work again.
  13. It seems like it doesn't set the handling at all. I use this to set it: for k, v in ipairs(getElementsByType("vehicle")) do local model = getElementModel(v) if model == 542 then setVehicleHandling(v, "modelFlags", 0x00002000) end end also tried with setVehicleHandling(v, "modelFlags", tonumber("0x00002000")) but nothing. I also made a command which gets my current vehicle's modelFlags value and it always seems to be the exact same one - doesn't matter if I set it to 0x00002000 or not. Here's that function: function asdas() local handlingTable = getVehicleHandling(getPedOccupiedVehicle(localPlayer)) local value = handlingTable["modelFlags"] outputChatBox(value) end addCommandHandler("go", asdas) Will try with Hedit now. @Tut indeed it does work when I set it with hedit
  14. It doesn't seem to work. Should the default GTA:SA car have two exhausts or this would work even if it doesn't? The Clover has only one exhaust, but my custom model has two.
  15. So I should use setVehicleHandling but it needs Hexadecimal/Decimal value for the modelFlags according to the Wiki. How exactly should this be done as there are none such given where DBL_EXHAUST is? I opened the handling.cfg of GTA:SA and there it says this: ; (af) modelFlags!!! WARNING - Now written HEX for easier reading of flags ; ; 1st digit 1: IS_VAN 2: IS_BUS 4: IS_LOW 8: IS_BIG ; 2nd digit 1: REVERSE_BONNET 2: HANGING_BOOT 4: TAILGATE_BOOT 8: NOSWING_BOOT ; 3rd digit 1: NO_DOORS 2: TANDEM_SEATS 4: SIT_IN_BOAT 8: CONVERTIBLE ; 4th digit 1: NO_EXHAUST 2: DOUBLE_EXHAUST 4: NO1FPS_LOOK_BEHIND 8: FORCE_DOOR_CHECK ; 5th digit 1: AXLE_F_NOTILT 2: AXLE_F_SOLID 4: AXLE_F_MCPHERSON 8: AXLE_F_REVERSE ; 6th digit 1: AXLE_R_NOTILT 2: AXLE_R_SOLID 4: AXLE_R_MCPHERSON 8: AXLE_R_REVERSE ; 7th digit 1: IS_BIKE 2: IS_HELI 4: IS_PLANE 8: IS_BOAT ; 8th digit 1: BOUNCE_PANELS 2: DOUBLE_RWHEELS 4: FORCE_GROUND_CLEARANCE 8: IS_HATCHBACK
  16. Hey guys, Been almost a year since I did something with MTA's Lua but now got interested and made a race map using this Chevrolet Impala 1967 model to replace the Clover. As you can probably guess I'm a huge fan of Supernatural and want to have every detail like it is on the show. So here's my question: How to make the right exhaust of the car emmit smoke as does the left one? I've seen double exhaust cars in GTA:SA (I think one was the Banshee but I can be wrong) but I want to use the Clover in this map as its handling is perfect. Any ideas? The only thing I could find was this topic but I am not familiar at all with .dff editing etc and the guy who suggested that hasn't been active for 2-3 years now:
  17. This is truly amazing. Great work and thank you for sharing it with everybody
  18. I haven't really made DX buttons so can't say for sure. My buttons and menus at my server are the default MTA ones (non-DX). I used my method to scale all DX rectangles & texts on the screen and it works quite well with those.
  19. Nice trick for the scale on :~ty resolutions Also here's a similar topic which @Halemade and I expanded with another method as well:
  20. So we should all use that MTA version you linked lastly and not update?
  21. If you meant the client part of that version then no, I tried it and there was no freeze at all. Maybe a slight lag but it was less than a second so could've been anything. Definitely better than before with your linked MTA client version.
  22. Hello, I'm a member of a racing clan called SiK - Speed is King and we've had a MTA server since 2009. There were no problems with it until a few weeks ago when every time a player finishes there is a huge lag or freeze and it either gets stuck at Not Responding of the entire MTA client or it gives a bunch of random error from various resources. When I stop the resources it says are giving error it just says another resource gives other error and so on. I tried to stop all resources except the race, mapmanager, votemanager, mapcycler and the lag/freeze was still there. Then I tried the latest race resource and the lag went away but the problem is that the old race was edited throughout the years by many people with some custom functions. We tried copying the custom lines from the old SiK resource to the new race resource but the lag was still there. Something is causing it from those edits but it doesn't give a proper warning or error in debugscript 3. Is this a known issue with the latest MTA client update and very old resources? Almost all of my teammembers have the exact same issue and it started at the same time too. But weirdly enough a few people don't have any issue at all which is just strange. Any help is appreciated.
  23. Hey guys, been a while since I posted here. Today I got my brand new AMD Radeon RX 580 8GB GPU and in around 2 months time I'll completely change my PC and the new one will have 2 RX 580s. Is MTA/GTA SA compatible with Crossfire so I can take full advantage of both cards? 2 RX 580 = 1 1080 Ti or a tiny bit better if both are used together.
×
×
  • Create New...