20.03.2013, 15:48
pawn Код:
//
SetTimer("Velocimetro", 1, 1);
//
public Velocimetro(){
new Float:VehicleHP;
for(new i = 0; i < MAX_PLAYERS; i++){
new vehicleid = GetPlayerVehicleID(i);
new _str[256];
GetVehicleHealth(vehicleid, VehicleHP);
format(_str, sizeof(_str), "~b~~>~Veiculo:~w~ %s~n~~b~~>~Velocidade:~w~ %d KM/h~n~~b~~>~Combustivel: ~W~%d%%~n~~b~~>~Lataria: ~W~%0.0f%%~n~~b~~>~Blindagem: ~W~%d%%~n~~b~~>~Localizacao:~w~ %s", vehName[GetVehicleModel(vehicleid)-400], GetPlayerSpeed(i, true), Gasolina[vehicleid], VehicleHP/10, Blindagem[vehicleid], ReturnPlayerZone(i));
TextDrawSetString(Speedometer[i], _str);
}
}
pawn Код:
new
TimerSpeed[MAX_PLAYERS]
;
public OnPlayerConnect(playerid)
{
TimerSpeed[playerid] = SetTimerEx("Velocimetro", 100, true, "d", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(TimerSpeed[playerid]);
return 1;
}
public Velocimetro(playerid)
{
new Float:VehicleHP;
new vehicleid = GetPlayerVehicleID(playerid);
new _str[256];
GetVehicleHealth(vehicleid, VehicleHP);
format(_str, sizeof(_str), "~b~~>~Veiculo:~w~ %s~n~~b~~>~Velocidade:~w~ %d KM/h~n~~b~~>~Combustivel: ~W~%d%%~n~~b~~>~Lataria: ~W~%0.0f%%~n~~b~~>~Blindagem: ~W~%d%%~n~~b~~>~Localizacao:~w~ %s", vehName[GetVehicleModel(vehicleid)-400], GetPlayerSpeed(playerid, true), Gasolina[vehicleid], VehicleHP/10, Blindagem[vehicleid], ReturnPlayerZone(playerid));
TextDrawSetString(Speedometer[playerid], _str);
return 1;
}