Problem with my speedometer :( - 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: Problem with my speedometer :( (
/showthread.php?tid=344549)
Problem with my speedometer :( -
Papacool - 21.05.2012
Hi,
I have a problem,
ID 0 sees the speedo perfectly, but ID 1 sees in double, ID 3 in triple, etc..
Here the ID 5 screenshot for example:
http://www.noelshack.com/2012-21-133...-sa-mp-094.png
Here my script:
IN THE TOP:
pawn Код:
new PlayerText:speedo[MAX_PLAYERS][6];
the array [6] is for some decor of my speedo
The Timer:
pawn Код:
public Speedometer()
{
new fstring[32], string[512];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
// I have other stuff here, but i have comment them
format(fstring,sizeof(fstring),"~n~Km/h: ~w~%d", GetPlayerSpeed(i, true));
strcat(string, fstring, sizeof(string));
PlayerTextDrawSetString(i, speedo[i][5], string);
}
}
}
Under
OnPlayerConnect I create textdraw for player:
pawn Код:
speedo[playerid][5] = CreatePlayerTextDraw(playerid,436.000000, 319.000000, " ");
PlayerTextDrawBackgroundColor(playerid,speedo[playerid][5], 255);
PlayerTextDrawFont(playerid,speedo[playerid][5], 1);
PlayerTextDrawLetterSize(playerid,speedo[playerid][5], 0.470000, 1.400000);
PlayerTextDrawColor(playerid,speedo[playerid][5], -1);
PlayerTextDrawSetOutline(playerid,speedo[playerid][5], 0);
PlayerTextDrawSetProportional(playerid,speedo[playerid][5], 1);
PlayerTextDrawSetShadow(playerid,speedo[playerid][5], 1);
What's wrong please ?
Thanks and Have a nice day