TextDrawColor string problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: TextDrawColor string problem (
/showthread.php?tid=260320)
TextDrawColor string problem -
chosen - 08.06.2011
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.
Re: TextDrawColor string problem -
iGetty - 08.06.2011
pawn Код:
TextDrawColor(textid, string);
Should that not be,
pawn Код:
TextDrawColor(OnTextFade, string);
?
Re: TextDrawColor string problem -
Firzendxiw - 08.06.2011
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);
Re: TextDrawColor string problem -
Vince - 08.06.2011
Colors are numbers, not strings!
Re: TextDrawColor string problem -
Firzendxiw - 08.06.2011
OMFG how did I miss that lol, too tired to complain over lack of conciousness
Re: TextDrawColor string problem -
chosen - 08.06.2011
So, how should I do? As in 0xFF0000 are letters too, not only numbers :-s
Re: TextDrawColor string problem -
Vince - 08.06.2011
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!