Quote:
Originally Posted by Emera
I suggest you use a GANI to display the nicknames. You an do much more with a GANI than you can with that. That is what we use on Lexia. Here is a bare bone system.
|
You don't need to use a timeout in a GANI like that, also you have an else on a with statement which makes no sense.
You could use a GANI script like this:
PHP Code:
SCRIPT
function onPlayerEnters() {
with (findimg(2)) {
text = player.nick;
x = player.x;
y = player.y;
attachtoowner = true;
attachoffset = {1.5, 3.4};
style = "bc";
layer = 0;
mode = 1;
}
}
SCRIPTEND
and when the player's nickname changes on the server-side you can just update the attr you're using. I.e:
PHP Code:
function onPlayerNickChanges(obj) {
obj.attr[3] = "";
obj.attr[3] = "nickname.gani";
}
Quote:
Originally Posted by Nogross
What do you suggest then? And also the script I use atm. works perfectly, the only proplem is that it overdraws the texts if there are more then 2 people in a room.
|
The way you're doing it now is what I would use personally, it's much more flexible. Nicknames systems have been the source of lag complaints though so I wouldn't even make one tbh. I prefer mouse-over to display nickname systems at the end of the day.
Please learn to style your script, or at least run it through my
http://fp4.ca/gs2beautifier/ before posting your script.
PHP Code:
//#CLIENTSIDE
function onCreated() {
enablefeatures(200);
setTimer(0.05);
}
function onTimeOut() {
this.hideimgs(200, 4000); // Hide all potential images from last timeout
this.i = 0; // Set this.i to 0
for (temp.pl: players) {
this.showtext(200 + this.i, temp.pl.x + 1.57, temp.pl.y + 3.05, "Arial", "cb", @ temp.pl.nick);
changeimgcolors(200 + this.i, 0.5, 1, 0.5, 1);
changeimgvis(200 + this.i, 1);
changeimgzoom(200 + this.i, 0.75);
this.i++;
this.showtext(201 + this.i, temp.pl.x + 1.57, temp.pl.y + 3.85, "Arial", "cb", @ temp.pl.hearts @ "/" @ temp.pl.maxhp);
changeimgcolors(201 + this.i, 1, 0.1, 0.1, 1);
changeimgvis(201 + this.i, 1);
changeimgzoom(201 + this.i, 0.65);
this.i++;
showtext(202 + this.i, temp.pl.x + 1.57, temp.pl.y + 4.35, "Arial", "cb", @ temp.pl.clientr.guildtag);
changeimgcolors(202 + this.i, 1, 1, 1, 1);
changeimgvis(202 + this.i, 1);
changeimgzoom(202 + this.i, 0.65);
}
setTimer(0.05);
}
If you're going to base your system off anyone's code base it off my 'player block drawer' in this post (2nd script):
http://forums.graalonline.com/forums...04&postcount=6