PDA

View Full Version : Message System [middle of screen]


xAndrewx
03-03-2008, 12:16 PM
Here's a message system, simply trigger the client to add a message.


Message Data = {"Message Type: [Guildmessage [green], normal [white]]", "Message Here", "Either Nickname or Account Name"}


//#CLIENTSIDE
function onActionClientSide()
{
this.drawMessage( {params[2] @ ":" SPC params[1], "bc", (params[0] == "Guildmessage"? {0, 1, 0}: {1, 1, 1}) } );
}

function drawMessage(stuff)
{
client.cMessages.insert(0, temp.stuff);
if (client.cMessages.size() >= 5)
{
client.cMessages.delete(5);
}

this.updateMessages();
}

function updateMessages()
{
for (temp.i: client.cMessages)
{
temp.o++;
temp.width = textwidth(0.6, "Tahoma", temp.i[1], temp.i[0]);

showtext(300 + temp.o, (screenwidth / 2) + (temp.width / 2), (screenheight - 16) - (temp.o * 16), "Tahoma", temp.i[1], temp.i[0]);
changeimgvis(300 + temp.o, 4);
changeimgzoom(300 + temp.o, 0.6);
changeimgcolors(300 + temp.o, temp.i[2][0], temp.i[2][1], temp.i[2][2], 1);

this.("mode_" @ temp.o) = temp.i[2];
this.("fade_" @ temp.o) = 1;
}

if (temp.o != null)
{
scheduleevent( (temp.o / 15) + 3, "Fade", "");
}
}

function onFade()
{
temp.i = client.cMessages.size();

this.("fade_" @ temp.i) -= 0.005;

if (this.("fade_" @ temp.i) <= 0)
{
client.cMessages.delete(temp.i - 1);
this.updateMessages();

return false;
}

temp.g = this.("mode_" @ temp.i);
changeimgcolors(300 + temp.i, temp.g[0], temp.g[1], temp.g[2], this.("fade_" @ temp.i));

scheduleevent(0.05, "Fade", "");
}

Dan
03-03-2008, 05:40 PM
Quite simple x-x

Maybe add some wraptext thing to make it a little special atleast? >_<

Rapidwolve24
03-03-2008, 11:45 PM
Maybe add some wraptext thing to make it a little special atleast? >_<

*Chuckles* :asleep:

Crow
03-04-2008, 03:53 PM
Hm, I remember this from somewhere ;P
It's the old /toguild thing that was used on Era. I'm not sure, but dont you need permission to post that? I know that "rule" is stupid, but still.