X+= (3 * floatsin(-A, degrees));
Y+= (3 * floatcos(-A, degrees));
public OnPlayerSpawn(playerid)
{
SetTimerEx("speedo",250,0,"i",playerid);
return 1;
}
forward speedo(playerid);
public speedo(playerid)
{
SetTimerEx("speedo",250,0,"i",playerid);
if(!IsPlayerInAnyVehicle(playerid)) return 0;
new formspeed[128],gpspe;
gpspe = GetPlayerSpeed(playerid,true);
format(formspeed,128,"%d km/h",gpspe);
TextDrawSetString(txtdraw[3][playerid],formspeed);
if(gpspe > 0 && gpspe < 80) TextDrawColor(txtdraw[3][playerid],COLOR_WHITE);
if(gpspe > 80 && gpspe < 150) TextDrawColor(txtdraw[3][playerid],COLOR_YELLOW);
if(gpspe > 150)
{
TextDrawColor(txtdraw[3][playerid],COLOR_RED);
if(GetPlayerWantedLevel(playerid) == 0) SetWantedLevel(playerid,1);
}
TextDrawShowForPlayer(playerid,txtdraw[3][playerid]);
return 1;
}
logischer fehler, Textdraws definiert, Farben valid
/e: GetPlayerSpeed definiert, gibt km/h als int zurück, SetWantedLevel auch