• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by koragg

  1. Hello, Today I tried to upload an uncompiled resource to the community site and it said that the upload was successful but when I clicked on the "View resource" link it gave me a link which ended with "id=0". When I went to My View to check the resource was not there but there is an empty space right where the resource should have been at the top. I did "Inspect Element" on it and it can be seen that there is no value assigned to the "id" attribute of the highlighted link. The empty space can be seen as well. When I tried to upload the same resource again without changing its version it again said that it was successful but it didn't show up in My View and was again with "id=0".
  2. The only thing stopping me from using this amazing tool is the NodeJS dependency. Right now I'm hosting my server from my local PC so it will work perfectly. But if I change to a real host they don't give access to the Linux console but only to the MTA server console which means I can't install NodeJS there and can't use it then. Ideal thing would be for it to be usable just like the IRC resource, only depending on websockets.dll (or .so).
  3. Also does this work for Lua files as well or only for models etc?
  4. Can I only disable default download and not use your event handlers? I just want to use the nice looking download bar for all of my server's resources but i can't edit each script to include the custom events in it - they're just too many :s
  5. Thanks for clearing some things up @IIYAMA, I know how to use OOP in Java/C#/C++/etc but it's a bit weird in Lua for some reason Fixed my problem with the below code put inside toptimes_server.Lua thanks to @Mihoje function onNickChange() setTimer(function() for id, player in ipairs(getElementsByType("player")) do g_SToptimesManager:queueUpdate(player) g_SToptimesManager:updateTopText() local playerPosition = g_SToptimesManager.mapTimes:getIndexForPlayer(player) clientCall(player, 'onServerSentToptimes', g_SToptimesManager.toptimesDataForMap, g_SToptimesManager.serverRevision, playerPosition) end end, 1500, 1) -- This delay has to be bigger than the one which sets the current player name in the maptimes_server.Lua file! end addEventHandler("onPlayerChangeNick", root, onNickChange)
  6. How to use it I guess. I tried the below and nothing happened. function onNickChange() self:updateTopText() end addEventHandler("onPlayerChangeNick", root, onNickChange) also tried this: function onNickChange() if g_SToptimesManager and g_SToptimesManager.mapTimes then g_SToptimesManager:updateTopText() end end addEventHandler("onPlayerChangeNick", root, onNickChange) as well as this: function onNickChange() if g_SToptimesManager then local map = exports.cr_mapmanager:getRunningGamemodeMap() local mapName = getResourceInfo(map, "name") or getResourceName(map) g_SToptimesManager:setModeAndMap("Sprint", mapName) end end addEventHandler("onPlayerChangeNick", root, onNickChange) Problem is I don't know how to work with OOP in Lua at all! Imo those things or at least one should've worked, but none do and I get no errors in /debugscript 3. Tried the above in the toptimes_server.Lua file^
  7. Hey guys, Is it possible to update the toptimes window forcefully for all players whenever a player changes their nickname? I tried using some of the functions in the resource but since it's all in OOP - Idk nothing. Basically I've made the toptimes script to record account names into the database and to show account data as top name for all players in the F5 window. Every time a player changes their nickname that account data also changes so I want to forcefully update the F5 toptimes window for all playes online in order for it to be exactly up to date with the top names.
  8. wow @IIYAMA thanks, I'll need some days to see how this works and if I can use it
  9. @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.
  10. 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.
  11. 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.
  12. 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.
  13. 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=
  14. Try a browser like this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11963
  15. 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.
  16. 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.
  17. Just updated it and it should work perfect now
  18. 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
  19. 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.
  20. I also tried setting it server-side but doesn't work again.
  21. 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
  22. 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.
  23. 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
  24. 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:
  25. This is truly amazing. Great work and thank you for sharing it with everybody