Search the Community

Showing results for tags 'notification'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 3 results

  1. Hello, I have a problem with the script on the notifications. The point is that the notifications show up one what I mean, but if you call it a few times the notification is imposed on each other. I want to show only one and the other to display only when the first one disappears. I have no idea how to do it. Thank you in advance for your help! Here The Code: local cFunc={} local cSetting={} NTSClient={} NTSClient.__index=NTSClient addEvent('onClientAddNotification', true) -- send to client - triggerClientEvent(player, 'onClientAddNotification', player, text, 'type') -- send to all clients - triggerClientEvent(root, 'onClientAddNotification', root, text, 'type') function NTSClient:new(...) local obj=setmetatable({}, {__index=self}) if obj.constructor then obj:constructor(...) end return obj end function NTSClient:render() local now = getTickCount() if now >= self.tick then self.tick = getTickCount()+30 self.count = self.count-2 end local bg_x, bg_y=937, 186 local x=self.sx/2-(bg_x/self.zoom)/2 if self.count==0 and self.nts[1] then self.fadeOut=self.nts[1] table.remove(self.nts, 1) end if self.count<=1 and self.count>0 then self.pos_y=4.7/self.zoom+self.count/self.zoom self.posTXT_y=4.20/self.zoom+self.count/self.zoom elseif self.count==0 then self.pos_y=4.7/self.zoom self.posTXT_y=4.20/self.zoom self.count=280 end if self.fadeOut then self.fadeOut.alpha=math.max(self.fadeOut.alpha-0.005, 0) dxDrawImage(x, self.pos_y, bg_x/self.zoom, bg_y/self.zoom, self.textures[tostring(self.fadeOut.type)], 0, 0, 0, tocolor(255, 255, 255, 255*self.fadeOut.alpha), true) dxDrawText(self.fadeOut.msg, x+(bg_x/6.25/self.zoom), self.posTXT_y, x+(bg_x/7/self.zoom)+bg_x/self.zoom-bg_x/5/self.zoom, self.posTXT_y+(bg_y/self.zoom), tocolor(255, 255, 255, 255*self.fadeOut.alpha), 0.5, self.font1, 'center', 'center', true, true, true) if self.fadeOut.alpha==0 then self.fadeOut=nil end end for i,v in pairs(self.nts) do if i>1 then return end if i>2 then return end v.alpha=math.min(v.alpha+0.065, 1) dxDrawImage(x, self.pos_y+((i-1)*150)/self.zoom, bg_x/self.zoom, bg_y/self.zoom, self.textures[tostring(v.type)], 0, 0, 0, tocolor(255, 255, 255, 255*v.alpha), true) dxDrawText(v.msg, x+(bg_x/6.25/self.zoom), self.posTXT_y+((i-1)*150)/self.zoom, x+(bg_x/7/self.zoom)+bg_x/self.zoom-bg_x/5/self.zoom, self.posTXT_y+(bg_y/self.zoom)+((i-1)*150)/self.zoom, tocolor(255, 255, 255, 255*v.alpha), 0.5, self.font1, 'center', 'center', true, true, true) end end function NTSClient:add(msg, type) if #self.nts==0 then self.count=280 end outputConsole("["..string.upper(type).."] "..msg) table.insert(self.nts, { msg=msg, type=type, alpha=0, tick=getTickCount() }) local snd=playSound('s/' ..type.. '.mp3') setSoundVolume(snd, 0.3) end function NTSClient:onAddNTS(data, type) if not data then return end if not type then return end NTSClass:add(data, type) end function NTSClient:constructor(...) self.count=280 self.fadeOut=nil self.nts={} local sx,sy=guiGetScreenSize() self.sx, self.sy=sx, sy self.zoom=2.4 self.lu_start=getTickCount() self.pos_y, self.posTXT_y=6/self.zoom, 4/self.zoom self.textures={ ['warning']=dxCreateTexture('i/nts_warning.png', 'dxt5', false, 'wrap'), ['error']=dxCreateTexture('i/nts_error.png', 'dxt5', false, 'wrap'), ['success']=dxCreateTexture('i/nts_success.png', 'dxt5', false, 'wrap'), ['info']=dxCreateTexture('i/nts_info.png', 'dxt5', false, 'wrap'), } self.font=dxCreateFont('f/myriad_prop.ttf', 20) self.font1=dxCreateFont('f/archivo_narrow.ttf', 20) self.funcAddNTS=function(data, type) self:onAddNTS(data, type) end addEventHandler('onClientAddNotification', root, self.funcAddNTS) self.renderFunc=function() self:render() end addEventHandler('onClientRender', root, self.renderFunc) self.tick = 10 end NTSClass=NTSClient:new()
  2. Why not working this notification system? Client side: local notifications = {} function createNotification(text2, typ, name1, name2) if typ == "simple" then text = name1.." "..text2 data = { text = text, startTime = getTickCount(), endTime = getTickCount() + 10000 } elseif typ == "duble" then text = name1.." "..text2.." "..name2 data = { text = text, startTime = getTickCount(), endTime = getTickCount() + 10000 } end table.insert(notifications, data) end addEvent( "createNotification", true ) addEventHandler( "createNotification", localPlayer, createNotification ) Server side: addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick, text2, typ, name1, name2) triggerServerEvent ("createNotification", root, text2, typ, name1, name2) end ) How to fix this problem in this script? Thanks the help!
  3. addEventHandler("onPlayerLogout", getRootElement(), function () local name = getPlayerName ( source ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." kilépett a tulajdonos szolgálatból!", "success") end end ) what wrong? onPlayerLogin working with this.. wtf?!