public OnGameModeInit()
{
Tacho = TextDrawCreate(548.000000, 422.000000, "KmH:");
TextDrawBackgroundColor(Tacho, 255);
TextDrawFont(Tacho, 1);
TextDrawLetterSize(Tacho, 0.500000, 1.000000);
TextDrawColor(Tacho, -1);
TextDrawSetOutline(Tacho, 0);
TextDrawSetProportional(Tacho, 1);
TextDrawSetShadow(Tacho, 1);
TextDrawUseBox(Tacho, 1);
TextDrawBoxColor(Tacho, 0x00000044);
TextDrawTextSize(Tacho, 639.000000, 0.000000);
return 1;
}
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new speedtext[24];
format(speedtext,sizeof(speedtext),"KmH: %d",Geschwindigkeit(playerid,true));
TextDrawSetString(Tacho, speedtext);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
TextDrawHideForPlayer(playerid,Tacho);
return 1;
}
Es buggt noch alles wenn man z.b. von der NRG fällt.
Gibt es eine Möglichkeit das ganze ohne OnPlayerUpdate zu regeln?