TextDraw Help!
#1

Good Day , I have a problem with TextDraw , when compile mode , throws an error, you do not know to fix ..

Code:

Код:
//new speedo and score player
new PlayerText:Textdraw052[MAX_PLAYERS];
new PlayerText:Textdraw053[MAX_PLAYERS];
new PlayerText:Textdraw054[MAX_PLAYERS];
new PlayerText:Textdraw055[MAX_PLAYERS];
new PlayerText:Textdraw056[MAX_PLAYERS];
new PlayerText:Textdraw057[MAX_PLAYERS];
new PlayerText:Textdraw058[MAX_PLAYERS];
new PlayerText:Textdraw059[MAX_PLAYERS];
new PlayerText:Textdraw060[MAX_PLAYERS];
new PlayerText:Textdraw061[MAX_PLAYERS];
Код:
//new speedo
Textdraw052 = TextDrawCreate(563.288452, 426.750000, "usebox");
TextDrawLetterSize(Textdraw052, 0.000000, -5.825922);
TextDrawTextSize(Textdraw052, 637.531494, 0.000000);
TextDrawAlignment(Textdraw052, 1);
TextDrawColor(Textdraw052, 0);
TextDrawUseBox(Textdraw052, true);
TextDrawBoxColor(Textdraw052, 102);
TextDrawSetShadow(Textdraw052, 0);
TextDrawSetOutline(Textdraw052, 0);
TextDrawFont(Textdraw052, 0);

Textdraw053 = TextDrawCreate(563.630859, 382.083312, "Minute:");
TextDrawLetterSize(Textdraw053, 0.255562, 1.261666);
TextDrawAlignment(Textdraw053, 1);
TextDrawColor(Textdraw053, -1378294017);
TextDrawSetShadow(Textdraw053, 0);
TextDrawSetOutline(Textdraw053, 2);
TextDrawBackgroundColor(Textdraw053, 51);
TextDrawFont(Textdraw053, 1);
TextDrawSetProportional(Textdraw053, 1);

Textdraw054 = TextDrawCreate(561.756958, 403.083312, "LD_SPAC:white");
TextDrawLetterSize(Textdraw054, 0.012180, -0.204165);
TextDrawTextSize(Textdraw054, 79.648590, 0.583353);
TextDrawAlignment(Textdraw054, 1);
TextDrawColor(Textdraw054, -1);
TextDrawSetShadow(Textdraw054, 0);
TextDrawSetOutline(Textdraw054, 0);
TextDrawFont(Textdraw054, 4);

Textdraw055 = TextDrawCreate(564.099182, 407.750030, "Score:");
TextDrawLetterSize(Textdraw055, 0.284610, 1.150833);
TextDrawAlignment(Textdraw055, 1);
TextDrawColor(Textdraw055, -1378294017);
TextDrawSetShadow(Textdraw055, 0);
TextDrawSetOutline(Textdraw055, 2);
TextDrawBackgroundColor(Textdraw055, 51);
TextDrawFont(Textdraw055, 1);
TextDrawSetProportional(Textdraw055, 1);

Textdraw056 = TextDrawCreate(640.594543, 377.749969, "usebox");
TextDrawLetterSize(Textdraw056, 0.000000, -2.855369);
TextDrawTextSize(Textdraw056, 559.757019, 0.000000);
TextDrawAlignment(Textdraw056, 1);
TextDrawColor(Textdraw056, 0);
TextDrawUseBox(Textdraw056, true);
TextDrawBoxColor(Textdraw056, 102);
TextDrawSetShadow(Textdraw056, 0);
TextDrawSetOutline(Textdraw056, 0);
TextDrawFont(Textdraw056, 0);

Textdraw057 = TextDrawCreate(576.749694, 347.666595, "Brzinomjer");
TextDrawLetterSize(Textdraw057, 0.272430, 0.818333);
TextDrawAlignment(Textdraw057, 1);
TextDrawColor(Textdraw057, -5963521);
TextDrawSetShadow(Textdraw057, 0);
TextDrawSetOutline(Textdraw057, 1);
TextDrawBackgroundColor(Textdraw057, 51);
TextDrawFont(Textdraw057, 1);
TextDrawSetProportional(Textdraw057, 1);

Textdraw058 = TextDrawCreate(565.036621, 358.166564, "150");
TextDrawLetterSize(Textdraw058, 0.449999, 1.600000);
TextDrawAlignment(Textdraw058, 1);
TextDrawColor(Textdraw058, -1061109505);
TextDrawSetShadow(Textdraw058, 0);
TextDrawSetOutline(Textdraw058, 1);
TextDrawBackgroundColor(Textdraw058, 51);
TextDrawFont(Textdraw058, 1);
TextDrawSetProportional(Textdraw058, 1);

Textdraw059 = TextDrawCreate(597.364624, 357.583251, "km/h");
TextDrawLetterSize(Textdraw059, 0.449999, 1.600000);
TextDrawAlignment(Textdraw059, 1);
TextDrawColor(Textdraw059, -1378294017);
TextDrawSetShadow(Textdraw059, 0);
TextDrawSetOutline(Textdraw059, 1);
TextDrawBackgroundColor(Textdraw059, 51);
TextDrawFont(Textdraw059, 1);
TextDrawSetProportional(Textdraw059, 1);

Textdraw060 = TextDrawCreate(600.175720, 383.250091, "50000");
TextDrawLetterSize(Textdraw060, 0.300073, 1.162500);
TextDrawAlignment(Textdraw060, 1);
TextDrawColor(Textdraw060, -5963521);
TextDrawSetShadow(Textdraw060, 0);
TextDrawSetOutline(Textdraw060, 1);
TextDrawBackgroundColor(Textdraw060, 51);
TextDrawFont(Textdraw060, 1);
TextDrawSetProportional(Textdraw060, 1);

Textdraw061 = TextDrawCreate(596.895996, 408.333374, "50000");
TextDrawLetterSize(Textdraw061, 0.316471, 1.133333);
TextDrawAlignment(Textdraw061, 1);
TextDrawColor(Textdraw061, 16711935);
TextDrawSetShadow(Textdraw061, 0);
TextDrawSetOutline(Textdraw061, 1);
TextDrawBackgroundColor(Textdraw061, 51);
TextDrawFont(Textdraw061, 1);
TextDrawSetProportional(Textdraw061, 1);
//end speedo
Код:
if(IsPlayerInAnyVehicle(playerid))
{
    PlayerTextDrawShow(playerid,Textdraw058[playerid]);
 TextDrawShowForPlayer(playerid,Textdraw059);
 TextDrawShowForPlayer(playerid,Textdraw056);
 new Float:speed_x,Float:speed_y,Float:speed_z,Float:FloatBrzine;
 new FFinalnaBrzina;
 new vozilo = GetPlayerVehicleID(playerid);
 GetVehicleVelocity(vozilo,speed_x,speed_y,speed_z);
 FloatBrzine = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*183.666667;
 FFinalnaBrzina = floatround(FloatBrzine,floatround_round);
 format(string, 256, "%d",FFinalnaBrzina);
 PlayerTextDrawSetString(playerid,Textdraw058[playerid], string);
}
 return 1;
}

ERROR

Код:
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3239) : error 033: array must be indexed (variable "Textdraw052")
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3240) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3241) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3242) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3243) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3244) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3245) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3246) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3247) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3248) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3250) : error 033: array must be indexed (variable "Textdraw053")
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3251) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3252) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3253) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3254) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3255) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3256) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3257) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3258) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3260) : error 033: array must be indexed (variable "Textdraw054")
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3261) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3262) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3263) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3264) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3265) : error 035: argument type mismatch (argument 1)
C:\Users\Dado\Desktop\JustPlay\gamemodes\jplay.pwn(3266) : error 035: argument type mismatch (argument 1)

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#2

Only example:
Код:
new PlayerText:welcomeText[MAX_PLAYERS];
 
public OnPlayerConnect(playerid)
{
    // First, create the textdraw
    welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my SA-MP server");
 
    // Now show it
    PlayerTextDrawShow(playerid, welcomeText[playerid]);
}
Based in Samp Wiki

@edit

You defined to PLAYERS and not to GLOBAL (server)
Reply
#3

it is gloabl textdraw not a player textdarw
and the way you have created the textdraws it shows that those are global so use blow things that i have told you

PHP код:
new Text:Textdraw052;
new 
Text:Textdraw053;
new 
Text:Textdraw054;
new 
Text:Textdraw055;
new 
Text:Textdraw056;
new 
Text:Textdraw057;
new 
Text:Textdraw058;
new 
Text:Textdraw059;
new 
Text:Textdraw060;
new 
Text:Textdraw061
change

PHP код:
PlayerTextDrawShow(playerid,Textdraw058[playerid]); 
to

PHP код:
TextDrawShowForPlayer(playerid,Textdraw058); 
change

PHP код:
PlayerTextDrawSetString(playerid,Textdraw058[playerid], string); 
to

PHP код:
TextDrawSetString(Textdraw058string); 
Reply
#4

My speedo its work .. Thank you !!! :P :P

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)