TextDraw Problem
#1

Hy , i have 1 problem with my speedometer [ textdraw ]

Errors:
Код:
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(710) : error 035: argument type mismatch (argument 2)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(711) : error 035: argument type mismatch (argument 2)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(712) : error 035: argument type mismatch (argument 2)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(714) : error 035: argument type mismatch (argument 1)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(717) : error 035: argument type mismatch (argument 1)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(720) : error 035: argument type mismatch (argument 1)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(724) : error 035: argument type mismatch (argument 2)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(725) : error 035: argument type mismatch (argument 2)
C:\Users\PCWORKING\Desktop\VirtualGaming\gamemodes\VGRPG.pwn(726) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Script:
Код:
new Text:SaTaNSpeedo[MAX_PLAYERS][4];
OnGameModeinit:
Код:
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		SaTaNSpeedo[i][0] = TextDrawCreate(499.554992, 360.000000, "~>~ Model: Maverikcopz ~<~");
		TextDrawBackgroundColor(SaTaNSpeedo[i][0], 255);
		TextDrawFont(SaTaNSpeedo[i][0], 2);
		TextDrawLetterSize(SaTaNSpeedo[i][0], 0.260000, 1.000000);
		TextDrawColor(SaTaNSpeedo[i][0], -1);
		TextDrawSetOutline(SaTaNSpeedo[i][0], 0);
		TextDrawSetProportional(SaTaNSpeedo[i][0], 1);
		TextDrawSetShadow(SaTaNSpeedo[i][0], 2);
		TextDrawUseBox(SaTaNSpeedo[i][0], 1);
		TextDrawBoxColor(SaTaNSpeedo[i][0], 75);
		TextDrawTextSize(SaTaNSpeedo[i][0], 637.000000, 0.000000);

		SaTaNSpeedo[i][1] = TextDrawCreate(499.554992, 375.000000, "~>~ Speed: 250 Km/h ~<~");
		TextDrawBackgroundColor(SaTaNSpeedo[i][1], 255);
		TextDrawFont(SaTaNSpeedo[i][1], 2);
		TextDrawLetterSize(SaTaNSpeedo[i][1], 0.290000, 1.000000);
		TextDrawColor(SaTaNSpeedo[i][1], -1);
		TextDrawSetOutline(SaTaNSpeedo[i][1], 0);
		TextDrawSetProportional(SaTaNSpeedo[i][1], 1);
		TextDrawSetShadow(SaTaNSpeedo[i][1], 2);
		TextDrawUseBox(SaTaNSpeedo[i][1], 1);
		TextDrawBoxColor(SaTaNSpeedo[i][1], 75);
		TextDrawTextSize(SaTaNSpeedo[i][1], 637.000000, 0.000000);

		SaTaNSpeedo[i][2] = TextDrawCreate(499.554992, 390.000000, "~>~ Fuel: 100% ~<~");
		TextDrawBackgroundColor(SaTaNSpeedo[i][2], 255);
		TextDrawFont(SaTaNSpeedo[i][2], 2);
		TextDrawLetterSize(SaTaNSpeedo[i][2], 0.290000, 1.000000);
		TextDrawColor(SaTaNSpeedo[i][2], -1);
		TextDrawSetOutline(SaTaNSpeedo[i][2], 0);
		TextDrawSetProportional(SaTaNSpeedo[i][2], 1);
		TextDrawSetShadow(SaTaNSpeedo[i][2], 2);
		TextDrawUseBox(SaTaNSpeedo[i][2], 1);
		TextDrawBoxColor(SaTaNSpeedo[i][2], 75);
		TextDrawTextSize(SaTaNSpeedo[i][2], 637.000000, 0.000000);
	}
Код:
Functie UpdateSpeed()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerInAnyVehicle(i))
		{
		    new vehicle = GetPlayerVehicleID(i);
			new speed;
			speed = GetVehicleSpeed(GetPlayerVehicleID(i), 0);
			new string1[150], string2[150], string3[150];
			TextDrawShowForPlayer(i, SaTaNSpeedo[0]);
			TextDrawShowForPlayer(i, SaTaNSpeedo[1]);
			TextDrawShowForPlayer(i, SaTaNSpeedo[2]);
			format(string1, sizeof(string1),"Speed: %d KM/H", speed);
			TextDrawSetString(SaTaNSpeedo[0], string1);

			format(string2,sizeof(string2),"Model: %s",VehicleNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
			TextDrawSetString(SaTaNSpeedo[1], string2);

			format(string3, sizeof(string3),"Fuel: %d%%", Gas[vehicle]);
			TextDrawSetString(SaTaNSpeedo[2], string3);
		}
		else
		{
			TextDrawHideForPlayer(i, SaTaNSpeedo[0]);
			TextDrawHideForPlayer(i, SaTaNSpeedo[1]);
			TextDrawHideForPlayer(i, SaTaNSpeedo[2]);
		}
	}
	return 1;
}
Line:
Код:
TextDrawShowForPlayer(i, SaTaNSpeedo[0]);
TextDrawShowForPlayer(i, SaTaNSpeedo[1]);
TextDrawShowForPlayer(i, SaTaNSpeedo[2]);
Код:
TextDrawSetString(SaTaNSpeedo[0], string1);
TextDrawSetString(SaTaNSpeedo[1], string2);
TextDrawSetString(SaTaNSpeedo[2], string3);
Код:
TextDrawHideForPlayer(i, SaTaNSpeedo[0]);
TextDrawHideForPlayer(i, SaTaNSpeedo[1]);
TextDrawHideForPlayer(i, SaTaNSpeedo[2]);
Reply
#2

Why doing the foreach statement when you can use these...

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
https://sampwiki.blast.hk/wiki/PlayerTextDrawColor
https://sampwiki.blast.hk/wiki/PlayerTextDrawBoxColor
https://sampwiki.blast.hk/wiki/PlayerTex...ackgroundColor
https://sampwiki.blast.hk/wiki/PlayerTextDrawAlignment
https://sampwiki.blast.hk/wiki/PlayerTextDrawLetterSize
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetOutline
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetShadow
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetString
https://sampwiki.blast.hk/wiki/PlayerTextDrawUseBox
Reply
#3

Good, the left
Quote:

error 035: argument type mismatch (argument 2)

Quote:

TextDrawShowForPlayer(i, SaTaNSpeedo[0]);

what is the problem?
Reply
#4

new Text:SaTaNSpeedo[MAX_PLAYERS][4];

to

new Text:SaTaNSpeedo[4];

You don't need MAX_PLAYERS if you're already showing it to "i".
Reply
#5

O'h shit....ty man +1 RP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)