Update3DTextLabelText | hexcode in the timer
#1

Good day,

My name is CIBERKILLER.
And I need your help once!
First I'm sorry for my really bad english, I'm finally out of Germany and still has my English quit teaching.
Well I've already tried on many types incorporate a color code in a timer!
It was only with integers, then string ("# Yellow2"), and now with Hextype (x).
Currently my code looks like this: SetTimerEx ("@UpdateLabel", 2500, false, "ixs", 0, Yellow2, "driving instructor: {FFFFFF} Sebastian");

Код:
@UpdateLabel(botid, color, newtext[]); @UpdateLabel(botid, color, newtext[]){
	print("function @UpdateLabel wird ausgefeuhrt!");
	Update3DTextLabelText(BotLabel[botid], color, newtext);
	printf("ID: %i | Color: %i | Neuer Text: %s", botid, color, newtext);
}
BotLabel I leave so create!
Код:
new Text3D:BotLabel[15];
Well the 3DTextLabel disappear and my print is from the here!
[13:06:44] ID: 0 | Color: -503381761 | New text: driving instructor: {FFFFFF} Sebastian
Does anyone have any idea how I could write it otherwise?

With best regards,
CIBERKILLER.
Reply
#2

"x" is not supported by SetTimerEx.
I'm not sure why you're updating text label in a timer but what ever, you may try converting your hex to integer and then sending it by SetTimerEx?
Reply
#3

I do not understand (bad english). I want to convert a HexCode to an integer? How do I do that?
Reply
#4

Код:
#define COLOUR_GREEN (0x00FF00AA)

new iColour = COLOUR_GREEN;
Source:
https://sampforum.blast.hk/showthread.php?tid=200876
Reply
#5

Unfortunately, it still works, I have just one function for convert the hex codes created!

Код:
SetTimerEx("@UpdateLabel", 2500, false, "iis", 0, Convertcolor(Gelb2), "Fahrlehrer: {FFFFFF}Sebastian");

stock Convertcolor(hexcode)
{
	new color = hexcode;
	return color;
}
What am I doing wrong here?
Reply
#6

It's not possible to send string with SetTimerEx. Btw why are you using @?

https://sampwiki.blast.hk/wiki/Public_functions

And I still do not understand why you're trying to update label under timer when you can do it directly in code?
Reply
#7

@MicroD

You can also use @ instead of forward & public, it is so called normal)
With the @ it's still a callback!
Reply
#8

Well, I skipped that day in school.
Reply
#9

I do not know now what do you want from me, but do you have a tip for me how I can do now?
Reply
#10

I asked you why would you use timer when something that you're doing in this example does not need a timer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)