18.01.2013, 22:44
Quote:
sry for a noob question again, but why does this code not work?
Code:
public carhealth() { new Float:tmp; new tmpp[256]; new tmppp[256]; for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerInAnyVehicle(i)) { GetVehicleHealth(GetPlayerVehicleID(i), tmp); format(tmpp,255,"%f",tmp / 10); valstr(tmppp,strval(tmpp)); TextDrawDestroy(carhp[i]); carhpshown[i] = 0; format(tmpp,255,"%d km/h~n~%s%",kmph[i], tmppp); carhp[i] = TextDrawCreate(500, 380, tmpp); TextDrawUseBox(carhp[i], 1); TextDrawBoxColor(carhp[i], 0x88888877); TextDrawShowForPlayer(i, carhp[i]); carhpshown[i] = 1; } else { if(carhpshown[i] == 1) { TextDrawDestroy(carhp[i]); carhpshown[i] = 0; } } } } I used arrays as said here, but i still cant find the error. |
any solution?, thanks