TextDrawColor string problem
#1

I'm trying to make a text fade function, and I have a little problem:

This is my function..
pawn Код:
public OnTextFade(Text:textid, textcolor)
The error occurs here:
pawn Код:
format(string, sizeof(string), "%sEE", textcolor);
TextDrawColor(textid, string); // This is the line ( error 035: argument type mismatch (argument 2) )
I'm using a timer to get there:
pawn Код:
gTextFade = SetTimerEx("OnTextFade", 100, true, "ss", "ServerRestart", "0xFF0000");
So... where is the problem?

Thanks in advance.
Reply
#2

pawn Код:
TextDrawColor(textid, string);
Should that not be,

pawn Код:
TextDrawColor(OnTextFade, string);
?
Reply
#3

Quote:
Originally Posted by getty154
Посмотреть сообщение
pawn Код:
TextDrawColor(textid, string);
Should that not be,

pawn Код:
TextDrawColor(OnTextFade, string);
?
Na I dont think thats the problem, hes already defined the textdraw as textid, thats what I'm assuming from the limited information given.

pawn Код:
format(string, sizeof(string), "%sEE", textcolor);
//shouldn't that be
format(string, sizeof string, "%sEE", textcolor);
Reply
#4

Colors are numbers, not strings!
Reply
#5

OMFG how did I miss that lol, too tired to complain over lack of conciousness
Reply
#6

So, how should I do? As in 0xFF0000 are letters too, not only numbers :-s
Reply
#7

Alright then. Open up your Windows Calculator, go to the 'View' menu and choose 'Programming'. In the left menu choose Hex and Dword. Type in the main box: FF0000. Now put your calculator on Decimal again in the left menu. See? A number!

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)