mtamaster97 Posted September 23, 2014 Posted September 23, 2014 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).
'LinKin Posted September 23, 2014 Posted September 23, 2014 Hmm, IMO you shouldn't be into this. However; You can use a table to store the messages and then onClientRender use a for loop on the table and show them changing the height where they're drawn.
Mr_Moose Posted September 23, 2014 Posted September 23, 2014 (edited) Well it's relatively simple, like a top bar which lists messages and fade them out after a while, you could try modifying this one: https://github.com/GTWCode/GTW-RPG/tree/master/%5Bresources%5D/GTWtopbar by adding images and recalculate the position details so it shows on the right (or left side). Edited April 16, 2015 by Guest
Saml1er Posted September 23, 2014 Posted September 23, 2014 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)
mtamaster97 Posted September 23, 2014 Author Posted September 23, 2014 Thank you both, especially you LinKin, good luck with gamemode, have fun makin' it bro
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now