SA-MP Forums Archive
What's wrong here? - 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)
+--- Thread: What's wrong here? (/showthread.php?tid=381949)



What's wrong here? - dott - 01.10.2012

pawn Код:
version = TextDrawCreate(572.000000, 419.000000, "Version: %s", S_VERSION);
    TextDrawBackgroundColor(version, 90);
    TextDrawFont(version, 1);
    TextDrawLetterSize(version, 0.290000, 2.200000);
    TextDrawColor(version, -1);
    TextDrawSetOutline(version, 0);
    TextDrawSetProportional(version, 1);
S_VERSION is defined on top of the script, but i get this warning on the TextDrawCreate line:

Код:
warning 202: number of arguments does not match definition
What's wrong?


Re: What's wrong here? - SuperViper - 01.10.2012

You can't format a string through TextDrawCreate. You need to use format.

pawn Код:
new textDisplay[25];
format(textDisplay, sizeof(textDisplay), "Version: %s", S_VERSION);
version = TextDrawCreate(572.000000, 419.000000, textDisplay);



Re: What's wrong here? - newbienoob - 01.10.2012

The problem is here
pawn Код:
version = TextDrawCreate(572.000000, 419.000000, "Version: %s", S_VERSION);
Remove "S_VERSION". TextDrawCreate has only 3 parameters; X, Y, Text[]


AW: What's wrong here? - dott - 01.10.2012

Alright, thanks guys