forward Speedometer(playerid); public Speedometer(playerid) { new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int; vehicleid = GetPlayerVehicleID(playerid); //new Float:vehicle_health,final_vehicle_health,health_string[256]; if(vehicleid != 0) { GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z); final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672= mph final_speed_int = floatround(final_speed,floatround_round); format(speed_string,256,"%i",final_speed_int); TextDrawSetString(speedo0[playerid], speed_string); } else { TextDrawSetString(speedo0[playerid], " "); TextDrawSetString(speedo1[playerid], " "); } return 1; }
TextDrawShowForPlayer(playerid, speedo0[playerid]); TextDrawShowForPlayer(playerid, speedo1[playerid]); TextDrawShowForPlayer(playerid, speedo2[playerid]); TextDrawShowForPlayer(playerid, speedo3[playerid]);
if I use player text draw I get alot of warnings for tag mismatch
|
and thats how most of the speedos are made at the tutorials on forum, using global textdraws.
|
I've just told you what you need to do.
That's because you need to use the player textdraw functions with player textdraws + an array (you would've known that if you read the wiki page I linked). You can't use for example TextDrawSetString for both global textdraws and player textdraws. TextDrawSetString is for global textdraws. PlayerTextDrawSetString is for player textdraws. Then clearly those tutorials are bad, or you didn't understand a good one. Judging from your comment on this one, that's what you're referring to. That tutorial is from august 2010, that's 6.3 years! Of course it's outdated! |
C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(9054) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(9055) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(9056) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(9057) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40316) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40317) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40318) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40319) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40349) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40350) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40351) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(40352) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41814) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41815) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41816) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41817) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41875) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41876) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41877) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(41878) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43681) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43682) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43683) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43684) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43690) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43691) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43692) : warning 213: tag mismatch C:\Users\andrei\Desktop\Scripting SA-MP\Advanced Roleplay (IBP)\gamemodes\panda.pwn(43693) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 28 Warnings.