rssdrawdata
Category: | script |
---|---|
Author(s): | OGF |
Downloads: | 1361 |
Rate: | You need to be logged in to vote |
Rating: | 3.8 (32 Votes) |
Description:
Read the change log below. and the readme.txt
As you see on many servers now day there is a nice looking bar at the top of the screen or the bottom that displays things the regular chat usually would.
Things like. * Total_Motherfucker has just joined
I see it as a good way to keep those things out of the chat.
you can set it to whatever you want using the outputDraw function which is exportable. Remember that does not come with this script
This script only contains the function outputDraw which you can export from your resource. Read the readme.txt
SYNTAX for "outputDraw" : outputDraw ( string text, int r, int g, int b[, bool colorCoded=false ] )
You must export the function as so.
exports["drawData"]:outputDraw ( text, r, g, b, false )
Examples below.
Required Arguments:
text: the text string you wish to send to the drawData. It cannot exceed 65 characters or it will return false.
R: The amount of red in the color of the text.
G: The amount of green in the color of the text.
B: The amount of blue in the color of the text.
Optional Arguments:
colorCoded: A boolean determining whether or not '#RRGGBB' tags should be used on text. false by default.
so it has a similar syntax to outputChatBox, which is what I am trying to shoot for.
How do I export the function?
Excellent question!
Luckily there is a call function in LUA/MTA that allows us to do this!
https://wiki.multitheftauto.com/wiki/Call
Let's say like in the screenshots you want it to show when a player changes his name. Assuming you are using another resource which should be the case.
EXAMPLE: Client:
addEventHandler ( "onClientPlayerChangeNick", root,
function ( oldNick, newNick )
nickData = "* " .. oldNick .. " is now known as " .. newNick .. "."
exports["drawData"]:outputDraw ( nickData, 255, 100, 100, false )
end
)
A good way to test this script is while this resource is running do /start runcode then press f8 and do crun exports["drawData"]:outputDraw ( "test", 255, 0, 255, false )
Or exports["drawData"]:outputDraw ( "#ff0000test#ffffffme", 255, 0, 255, true ) this is a good way to show you how the function works..read on for examples.
You can also just assign it to a variable.
The readme.txt file has many another example. And more info.
** Added an option in the meta.xml to set the text size. Just change the 'value' to your liking. Best to keep it below 1.5
Don't click, just copy and paste.
www.i.imgur.com/fqH8l7D.jpg?1
www.i.imgur.com/w9aklh8.jpg?1
www.i.imgur.com/0r1wBAS.jpg?1
www.i.imgur.com/KunURh8.jpg?1...
(more)
As you see on many servers now day there is a nice looking bar at the top of the screen or the bottom that displays things the regular chat usually would.
Things like. * Total_Motherfucker has just joined
I see it as a good way to keep those things out of the chat.
you can set it to whatever you want using the outputDraw function which is exportable. Remember that does not come with this script
This script only contains the function outputDraw which you can export from your resource. Read the readme.txt
SYNTAX for "outputDraw" : outputDraw ( string text, int r, int g, int b[, bool colorCoded=false ] )
You must export the function as so.
exports["drawData"]:outputDraw ( text, r, g, b, false )
Examples below.
Required Arguments:
text: the text string you wish to send to the drawData. It cannot exceed 65 characters or it will return false.
R: The amount of red in the color of the text.
G: The amount of green in the color of the text.
B: The amount of blue in the color of the text.
Optional Arguments:
colorCoded: A boolean determining whether or not '#RRGGBB' tags should be used on text. false by default.
so it has a similar syntax to outputChatBox, which is what I am trying to shoot for.
How do I export the function?
Excellent question!
Luckily there is a call function in LUA/MTA that allows us to do this!
https://wiki.multitheftauto.com/wiki/Call
Let's say like in the screenshots you want it to show when a player changes his name. Assuming you are using another resource which should be the case.
EXAMPLE: Client:
addEventHandler ( "onClientPlayerChangeNick", root,
function ( oldNick, newNick )
nickData = "* " .. oldNick .. " is now known as " .. newNick .. "."
exports["drawData"]:outputDraw ( nickData, 255, 100, 100, false )
end
)
A good way to test this script is while this resource is running do /start runcode then press f8 and do crun exports["drawData"]:outputDraw ( "test", 255, 0, 255, false )
Or exports["drawData"]:outputDraw ( "#ff0000test#ffffffme", 255, 0, 255, true ) this is a good way to show you how the function works..read on for examples.
You can also just assign it to a variable.
The readme.txt file has many another example. And more info.
** Added an option in the meta.xml to set the text size. Just change the 'value' to your liking. Best to keep it below 1.5
Don't click, just copy and paste.
www.i.imgur.com/fqH8l7D.jpg?1
www.i.imgur.com/w9aklh8.jpg?1
www.i.imgur.com/0r1wBAS.jpg?1
www.i.imgur.com/KunURh8.jpg?1...
(more)