Hallo,
ich möchte da wo meine Autos erstellt werden das der Meter Stand auf 0 gesetzt werden.
Nur leider funktioniert dies nicht..
Ist es möglich bei jedem auto was spawnt den Meter stand auf 0 zu setzten?
Habe es schon bei OnVehiclespawn gemacht aber irgendwie bringt es nichts..
Danke im vorraus.
Code:
public PlayerCarConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
return 1;
}
new string[128],
playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
format(string, sizeof(string), "cars/%dAutoNR%d.ini", PlayerInfo[playerid][pSQLID], h);
if(fexist(string))
{
new data[256];
Meters[h] = 0;
data = dini_Get(string,"AH_Typ"); Carlist[playerid][h][Typ] = strval( data );
data = dini_Get(string,"AH_X"); Carlist[playerid][h][pos_x] = floatstr( data );
data = dini_Get(string,"AH_Y"); Carlist[playerid][h][pos_y] = floatstr( data );
data = dini_Get(string,"AH_Z"); Carlist[playerid][h][pos_z] = floatstr( data );
data = dini_Get(string,"AH_Rot"); Carlist[playerid][h][z_angle] = floatstr( data );
data = dini_Get(string,"AH_Status"); Carlist[playerid][h][Status] = strval( data );
data = dini_Get(string,"AH_Lock"); Carlist[playerid][h][Lock] = strval( data );
data = dini_Get(string,"AH_Paintjob"); Carlist[playerid][h][Paintjob] = strval( data );
data = dini_Get(string,"AH_Farbe1"); Carlist[playerid][h][Farbe1] = strval( data );
data = dini_Get(string,"AH_Farbe2"); Carlist[playerid][h][Farbe2] = strval( data );
data = dini_Get(string,"AH_mod1"); Carlist[playerid][h][mod1] = strval( data );
data = dini_Get(string,"AH_mod2"); Carlist[playerid][h][mod2] = strval( data );
data = dini_Get(string,"AH_mod3"); Carlist[playerid][h][mod3] = strval( data );
data = dini_Get(string,"AH_mod4"); Carlist[playerid][h][mod4] = strval( data );
data = dini_Get(string,"AH_mod5"); Carlist[playerid][h][mod5] = strval( data );
data = dini_Get(string,"AH_mod6"); Carlist[playerid][h][mod6] = strval( data );
data = dini_Get(string,"AH_mod7"); Carlist[playerid][h][mod7] = strval( data );
data = dini_Get(string,"AH_mod8"); Carlist[playerid][h][mod8] = strval( data );
data = dini_Get(string,"AH_mod9"); Carlist[playerid][h][mod9] = strval( data );
data = dini_Get(string,"AH_mod10"); Carlist[playerid][h][mod10] = strval( data );
data = dini_Get(string,"AH_mod11"); Carlist[playerid][h][mod11] = strval( data );
data = dini_Get(string,"AH_mod12"); Carlist[playerid][h][mod12] = strval( data );
data = dini_Get(string,"AH_mod13"); Carlist[playerid][h][mod13] = strval( data );
data = dini_Get(string,"AH_mod14"); Carlist[playerid][h][mod14] = strval( data );
data = dini_Get(string,"AH_mod15"); Carlist[playerid][h][mod15] = strval( data );
data = dini_Get(string,"AH_mod16"); Carlist[playerid][h][mod16] = strval( data );
data = dini_Get(string,"AH_mod17"); Carlist[playerid][h][mod17] = strval( data );
data = dini_Get(string,"AH_SpawnSaveX"); Carlist[playerid][h][SpawnSaveX] = floatstr( data );
data = dini_Get(string,"AH_SpawnSaveY"); Carlist[playerid][h][SpawnSaveY] = floatstr( data );
data = dini_Get(string,"AH_SpawnSaveZ"); Carlist[playerid][h][SpawnSaveZ] = floatstr( data );
data = dini_Get(string,"AH_SpawnSaveRot"); Carlist[playerid][h][SpawnSaveRot] = floatstr( data );
data = dini_Get(string,"AH_TankVolumen"); Carlist[playerid][h][TankVolumen] = strval( data );
data = dini_Get(string,"AH_RepairTime"); Carlist[playerid][h][RepairTime] = strval(data);
data = dini_Get(string,"AH_Versicherung"); Carlist[playerid][h][Versicherung] = strval(data);
data = dini_Get(string,"AH_StandTime"); Carlist[playerid][h][StandTime] = strval(data);
}
if(Carlist[playerid][h][Typ] != -1 && Carlist[playerid][h][Status] == 0){
printf("Fahrzeugspeicherung: Beginning Spawn.");
Carlist[playerid][h][Carid] = CreateTunedCar(playerid, h);
printf("Fahrzeugspeicherung: End Spawn.");
}
}
return 1;
}