28.05.2012, 18:19
Hello guys. Well, first of all thanks to Milan for teaching me how to make such cool textdraws, but now i did something bad, and it only shows to ID 0...
I don't see any bad thing in my code, eigher some return that shouldn't be there. Kill me if the problem is some return. :P
Added one by one, tested all one per one, but as i was the id 0, it worked, now i called my friend, and only shows to him. xD
I don't see any bad thing in my code, eigher some return that shouldn't be there. Kill me if the problem is some return. :P
pawn Code:
Under on player connect:
SPEEDOS[playerid] = TextDrawCreate(500.500000, 308.000000, "");
FUEL[playerid] = TextDrawCreate(500.500000, 320.000000, "");
HEALTH[playerid] = TextDrawCreate(500.500000, 332.000000, "");
ID[playerid] = TextDrawCreate(500.500000, 344.000000, "");
TextDrawFont(SPEEDOS[playerid],1); //font type of textdraw
TextDrawUseBox(SPEEDOS[playerid] , 1);
TextDrawBoxColor(SPEEDOS[playerid] ,COLOR_GREY);
TextDrawLetterSize(SPEEDOS[playerid],0.399999,1.200000); //size...
TextDrawSetShadow(SPEEDOS[playerid],1);
TextDrawColor(SPEEDOS[playerid],COLOR_WHITE); //color
TextDrawShowForPlayer(playerid, SPEEDOS[playerid]);
TextDrawFont(FUEL[playerid],1); //font type of textdraw
TextDrawUseBox(FUEL[playerid] , 1);
TextDrawBoxColor(FUEL[playerid] ,COLOR_GREY);
TextDrawLetterSize(FUEL[playerid],0.399999,1.200000); //size...
TextDrawSetShadow(FUEL[playerid],1);
TextDrawColor(FUEL[playerid],COLOR_WHITE); //color
TextDrawShowForPlayer(playerid, FUEL[playerid]);
TextDrawFont(HEALTH[playerid],1); //font type of textdraw
TextDrawUseBox(HEALTH[playerid] , 1);
TextDrawBoxColor(HEALTH[playerid] ,COLOR_GREY);
TextDrawLetterSize(HEALTH[playerid],0.399999,1.200000); //size...
TextDrawSetShadow(HEALTH[playerid],1);
TextDrawColor(HEALTH[playerid],COLOR_WHITE); //color
TextDrawShowForPlayer(playerid, HEALTH[playerid]);
TextDrawFont(ID[playerid],1); //font type of textdraw
TextDrawUseBox(ID[playerid] , 1);
TextDrawBoxColor(ID[playerid] ,COLOR_GREY);
TextDrawLetterSize(ID[playerid],0.399999,1.200000); //size...
TextDrawSetShadow(ID[playerid],1);
TextDrawColor(ID[playerid],COLOR_WHITE); //color
TextDrawShowForPlayer(playerid, ID[playerid]);
public Speedometer(playerid)
{
new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int, fuel_string[256], id_string[256];
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != 0)
{
LoadVehicles();
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;
final_speed_int = floatround(final_speed,floatround_round);
new Float:vehicle_health,final_vehicle_health,health_string[256];
GetVehicleHealth(vehicleid,vehicle_health);
final_vehicle_health = floatround(floatround(vehicle_health - 250)/ 7.5);
format(health_string,256,"Health %i", final_vehicle_health);
format(speed_string,256,"Speed: %i Km/h", final_speed_int);
format(fuel_string,256,"Fuel: %i", CarInfo[vehicleid][Fuel]);
format(health_string,256,"Health: %i", final_vehicle_health);
format(id_string,256,"Car ID: %i", vehicleid);
TextDrawSetString(SPEEDOS[playerid], speed_string);
TextDrawSetString(FUEL[playerid], fuel_string);
TextDrawSetString(HEALTH[playerid], health_string);
TextDrawSetString(ID[playerid], id_string);
}
else
{
TextDrawSetString(SPEEDOS[playerid], "");
TextDrawSetString(FUEL[playerid], "");
TextDrawSetString(HEALTH[playerid], "");
TextDrawSetString(ID[playerid], "");
}
return 1;
}