Hey ich habe eine frage unswa will ich den Fahrzeug besitzer ausgeben lassen aber es funktioniert irgendwie nicht aber wieso ?
es wird mir immer Error angezeigt aber wieso ?
public TachoUpdate()
{
new string[128];
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(!IsPlayerInAnyVehicle(i))continue;
new veh = GetPlayerVehicleID(i),str[64],Float:hp,speed = GetVehicleSpeed(veh);
new vehicleid;
formatEx(str,"Speed: %d KM/H", speed);
TextDrawSetString(Tacho[i][Speed],str);
GetVehicleHealth(veh, hp);
hp = floatmul(floatdiv(100,750),(hp-250));
if(hp<=0.0){hp=0.0;}
formatEx(str,"Zustand: %.0f",hp);
TextDrawSetString(Tacho[i][Zustand],str);
formatEx(str,"%s", VehicleFriendlyNames[GetVehicleModel(veh)-400]), TextDrawSetString(Tacho[i][Name],str);
TextDrawSetString(Tacho[i][besitz],str);
formatEx(str,"%s", GetAutoBesitzer(i,vehicleid),TextDrawSetString(Tacho[i][besitz],str));
new vID = GetPlayerVehicleID(i);
format(string,sizeof(string),"Tank: %i Liter",tank[vID]);
TextDrawSetString(Tacho[i][ptank],string);
}
return 1;
}
public GetAutoBesitzer(playerid,vehicleid)
{
/*new string[68];
for(new sv = 0; sv < sizeof(cInfo); sv++)
{
format(string,sizeof(string),"%s",cInfo[sv][ckz]);
return TextDrawSetString(Tacho[playerid][besitz], string);
}*/
for(new i=0; i<MAX_FRAC_VEHICLES; i++)
{
if(fcars[i][fc_vID] == vehicleid)
{
if(fcars[i][fc_fracID] == 0) return TextDrawSetString(Tacho[playerid][besitz], "Error");
else if(fcars[i][fc_fracID] == 1) return TextDrawSetString(Tacho[playerid][besitz], "Polizei");
else if(fcars[i][fc_fracID] == 2) return TextDrawSetString(Tacho[playerid][besitz], "FBI");
else if(fcars[i][fc_fracID] == 3) return TextDrawSetString(Tacho[playerid][besitz], "Medic");
else if(fcars[i][fc_fracID] == 4) return TextDrawSetString(Tacho[playerid][besitz], "Oamt");
else if(fcars[i][fc_fracID] == 5) return TextDrawSetString(Tacho[playerid][besitz], "News");
else if(fcars[i][fc_fracID] == 6) return TextDrawSetString(Tacho[playerid][besitz], "Fahrschule");
else if(fcars[i][fc_fracID] == 7) return TextDrawSetString(Tacho[playerid][besitz], "Grove Street");
else if(fcars[i][fc_fracID] == 8) return TextDrawSetString(Tacho[playerid][besitz], "Ballas");
else if(fcars[i][fc_fracID] == 9) return TextDrawSetString(Tacho[playerid][besitz], "Vagos");
else if(fcars[i][fc_fracID] == 10) return TextDrawSetString(Tacho[playerid][besitz], "Aztecas");
else if(fcars[i][fc_fracID] == 11) return TextDrawSetString(Tacho[playerid][besitz], "S.F Rifa");
else if(fcars[i][fc_fracID] == 12) return TextDrawSetString(Tacho[playerid][besitz], "Lacosa Nostra");
else if(fcars[i][fc_fracID] == 13) return TextDrawSetString(Tacho[playerid][besitz], "Yakuza");
else if(fcars[i][fc_fracID] == 14) return TextDrawSetString(Tacho[playerid][besitz], "Russen Mafia");
else if(fcars[i][fc_fracID] == 15) return TextDrawSetString(Tacho[playerid][besitz], "Hitmna");
else if(fcars[i][fc_fracID] == 16) return TextDrawSetString(Tacho[playerid][besitz], "Wheelmann");
}
}
for(new c=0; c<sizeof(Jobc); c++)
{
if(GetPlayerVehicleID(playerid) == Jobc[code=c][v_ID])
{
if(Jobc[code=c][Jobid] == 2)
{
new string[30];
format(string,sizeof(string),"Müllmann");
convert_encoding(string);
return TextDrawSetString(Tacho[playerid][besitz], string);
}
else if(Jobc[code=c][Jobid] == 1)
{
new string[30];
format(string,sizeof(string),"Straßenreiniger");
convert_encoding(string);
return TextDrawSetString(Tacho[playerid][besitz], string);
}
else if(Jobc[code=c][Jobid] == 3)
{
return TextDrawSetString(Tacho[playerid][besitz], "Pizzeria");
}
else if(Jobc[code=c][Jobid] == 4)
{
return TextDrawSetString(Tacho[playerid][besitz], "Postamt");
}
else if(Jobc[code=c][Jobid] == 5)
{
return TextDrawSetString(Tacho[playerid][besitz], "Berarbeiter");
}
else if(Jobc[code=c][Jobid] == 6)
{
new string[30];
format(string,sizeof(string),"Holzfäller");
convert_encoding(string);
return TextDrawSetString(Tacho[playerid][besitz], string);
}
}
}
for(new i = 0; i<sizeof(newbie); i++)
{
if(GetPlayerVehicleID(playerid) == newbie[i])
{
return TextDrawSetString(Tacho[playerid][besitz], "Neuling");
}
}
return 1;
}