So richtig?
stock LoadVehicles()
{
new string[3], query[128], bool:added;
for(new i=0; i < MAX_VEHICLES; i++)
{
format(string, sizeof string, "%d", i);
format(VehInfo[i][Grund], 32, mysql_GetString("Autos", "Grund", "ID", string));
VehInfo[i][ModellID] = mysql_GetInt("Auto", "ModellID", "ID", string);
VehInfo[i][Fraktion] = mysql_GetInt("Auto", "Fraktion", "ID", string);
VehInfo[i][PosX] = mysql_GetFloat("Auto", "PosX", "ID", string);
VehInfo[i][PosY] = mysql_GetFloat("Auto", "PosY", "ID", string);
VehInfo[i][PosZ] = mysql_GetFloat("Auto", "PosZ", "ID", string);
VehInfo[i][Abgeschleppt] = mysql_GetInt("Auto", "Abgeschleppt", "ID", string);
VehInfo[i][inADAC] = mysql_GetInt("Auto", "inADAC", "ID", string);
VehInfo[i][Preis] = mysql_GetInt("Auto", "Preis", "ID", string);
VehInfo[i][NewX] = mysql_GetFloat("Auto", "NewX", "ID", string);
VehInfo[i][NewY] = mysql_GetFloat("Auto", "NewY", "ID", string);
VehInfo[i][NewZ] = mysql_GetFloat("Auto", "NewZ", "ID", string);
VehInfo[i][Farbe1] = mysql_GetFloat("Auto", "Farbe1", "ID", string);
VehInfo[i][Farbe2] = mysql_GetFloat("Auto", "Farbe2", "ID", string);
CreateVehicle(FrakAutos[g][ModellID],FrakAutos[g][PosX],FrakAutos[g][PosY],FrakAutos[g][PosZ],FrakAutos[g][PosR],FrakAutos[g][Farbe1],FrakAutos[g][Farbe2],-1);//250
}
if(added) SaveVehicles();
return 1;
}
Wie sieht es aus mit meinem Speicher Stock? muss ich den auch noch verändern?
stock SaveVehicles()
{
new string[34];
for(new i = 0; i < MAX_VEHICLES; i++)
{
format(string, sizeof string, "%d", i);
mysql_SetInt("Autos", "ModellID", VehInfo[i][ModellID], "ID", string);
mysql_SetInt("Autos", "Fraktion", VehInfo[i][Fraktion], "ID", string);
mysql_SetFloat("Autos", "PosX", VehInfo[i][PosX], "ID", string);
mysql_SetFloat("Autos", "PosY", VehInfo[i][PosY], "ID", string);
mysql_SetFloat("Autos", "PosZ", VehInfo[i][PosZ], "ID", string);
mysql_SetInt("Autos", "Abgeschleppt", VehInfo[i][Abgeschleppt], "ID", string);
mysql_SetInt("Autos", "inADAC", VehInfo[i][inADAC], "ID", string);
mysql_SetInt("Autos", "Preis", VehInfo[i][Preis], "ID", string);
mysql_SetString("Autos", "Grund", VehInfo[i][Grund], "ID", string);
mysql_SetFloat("Autos", "NewX", VehInfo[i][NewX], "ID", string);
mysql_SetFloat("Autos", "NewY", VehInfo[i][NewY], "ID", string);
mysql_SetFloat("Autos", "NewZ", VehInfo[i][NewZ], "ID", string);
}
return 1;
}