• Content Count

  • Joined

  • Last visited

  • Days Won


koragg last won the day on December 17 2017

koragg had the most liked content!

Community Reputation

130 Excellent

About koragg

  • Rank
  • Birthday 11/02/1997


  • Gang
    [SiK] Speed is King
  • Location
    Sofia, Bulgaria
  • Occupation
  • Interests
    (: Android, Mountain Biking, GTA SA & Selena Gomez :)

Recent Profile Visitors

7,061 profile views

    Hello, could you help me? I am creating a punishment panel, but I am missing a set timer to kill punished players and return to normal. Could you help me?



    1. koragg


      Hey, you'd be better off posting your problem in a topic so others can help out as well.

  2. 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".
  3. 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).
  4. Also does this work for Lua files as well or only for models etc?
  5. 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
  6. 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)
  7. 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^
  8. 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.
  9. wow @IIYAMA thanks, I'll need some days to see how this works and if I can use it
  10. @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.
  11. 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.
  12. 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.
  13. 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.
  14. 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=
  15. Try a browser like this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11963