14.09.2012, 23:49
Try debugging it in public SpeedoUpdate(playerid) (assuming that Fuel TD is updated succesfully here):
Check if the TextDraw ID is valid and if not please check what can compromise your speed variable and if you think you are getting over the Global TextDraw Limit, have a look at Player TextDraws.
If you can not determine the problem with these instructions, and you think the debug message contains correct informations about the TextDraw ID and the string, please post here your whole FuelUpdate function.
Edit: public functions like SpeedoUpdate must return a value, altough this cannot be associated with the problem.
pawn Код:
// ...
format(string,sizeof(string),"~g~Speed: ~w~%d mph",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*156.666667*0.641371192));
printf("[-Debug-] New Speed string for TextDraw ID # %d: [%d]'%s'", speed[playerid], strlen(string), string);
TextDrawSetString(speed[playerid],string)
format(string,sizeof(string),"~g~Fuel: ~w~%d%%",VehFuel[vehicleid]);
TextDrawSetString(fuel[playerid],string);
TextDrawShowForPlayer(playerid,fuel[playerid]);
TextDrawShowForPlayer(playerid,speed[playerid]);
}
}
If you can not determine the problem with these instructions, and you think the debug message contains correct informations about the TextDraw ID and the string, please post here your whole FuelUpdate function.
Edit: public functions like SpeedoUpdate must return a value, altough this cannot be associated with the problem.