Hallo,
ich habe eine Problem ich will das für jedes einzelndes Auto ein Kilometerzähler da ist.
Code:
public kilometer(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[50];
new Float:distanz;
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
distanz=GetDistanceFromPointToPoint(xx[playerid],yy[playerid],zz[playerid],x,y,z);
if(distanz>100) return 1;
distancee[playerid]=distancee[playerid]+distanz;
GetPlayerPos(playerid,xx[playerid],yy[playerid],zz[playerid]);
if(distancee[playerid]>100)
{
m[playerid]++;
distancee[playerid]=distancee[playerid]-100;
if(m[playerid]==10)
{
km[playerid]++;
m[playerid]=0;
}
format(string,sizeof(string),"Kilometer: %i.%i",km[playerid],m[playerid]);
TextDrawSetString(TextKILOMETER[i],string);
} }
return 1;
}
MfG