Jump to content

[Q&A]


mtamaster97

Recommended Posts

Hello, I wish if someone could give me Idea how to make this dx Rectangles with Info's about players joined, changed nick and else, but actualy I just dont know how to make that animation and make it appear in row like kill messages for example(dont tell me to look how they made it in killmessages cuz i tryed they use mta methods and some functions that are not explained in MTA Wiki so I dont understand anything almost).

notice.png

top.png

Link to comment

I made this one as simple as possible. ;)

  
          
local sx,sy =  guiGetScreenSize ()        
local messages = {"Test1","Test2","Test3" } 
local maximumRectangles = 9 
local MoveMessagesInSeconds = 2 
addEventHandler ("onClientPreRender",root, 
   function ()  
         if #messages > 0 and #messages <= maximumRectangles then  
            for i,v in ipairs (messages) do  
           local i2,i3 = i* ( sx*0.035) ,i * ( sx*0.0175) -- i2 for dxDrawText and i3 for rectangles 
           dxDrawRectangle(sx*(750/1024), (sy*0.5)+i3, sx*(240/1024) ,sy*( 20/1024), tocolor(0, 0, 0, 100), false) 
           dxDrawText ( v, sx*0.74,sy*(15/768), sx,sy+i2, tocolor ( 255,255,255, 255 ),sx*( 1/1024),  
    "default-bold","left","center",false,false,true,true ) 
        end 
    end 
end ) 
  
addEventHandler("onClientPlayerJoin",root, 
function ()  
table.insert(messages, getPlayerName(source).." has joined") 
 end  
 )  
  
 setTimer (  
 function ( ) 
table.remove(messages,#messages)  
 end,  MoveMessagesInSeconds*1000,0) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...