In der Schleife ganz normal halt nur mit einem i statt der playerid und dem Rang.
MFG
Ich nutze im stock um die Fraktionskasse zu speichern oder zu laden ja keine playerid, das ganze sieht so aus:
stock LoadKassen()
{
mysql_query("SELECT NULL FROM factions");
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
new string[3];
for(new i=0; i < rows; i++)
{
format(string, sizeof string, "%d", i);
TeamInfo[i][fKasse] = mysql_GetInt("factions", "Geld", "ID", string);
TeamInfo[i][fID]= mysql_GetInt("factions", "ID", "ID", string);
TeamInfo[i][Skin1]= mysql_GetInt("factions", "Skin1", "ID", string);
TeamInfo[i][Skin2]= mysql_GetInt("factions", "Skin2", "ID", string);
TeamInfo[i][Skin3]= mysql_GetInt("factions", "Skin3", "ID", string);
TeamInfo[i][Skin4]= mysql_GetInt("factions", "Skin4", "ID", string);
TeamInfo[i][Skin5]= mysql_GetInt("factions", "Skin5", "ID", string);
TeamInfo[i][Skin6]= mysql_GetInt("factions", "Skin6", "ID", string);
TeamInfo[i][Skin7]= mysql_GetInt("factions", "Skin7", "ID", string);
TeamInfo[i][Skin8]= mysql_GetInt("factions", "Skin8", "ID", string);
TeamInfo[i][Skin9]= mysql_GetInt("factions", "Skin9", "ID", string);
TeamInfo[i][Skin10]= mysql_GetInt("factions", "Skin10", "ID", string);
format(TeamInfo[i][Rang1],30,mysql_GetString("factions", "Rang1", "ID", string));
format(TeamInfo[i][Rang2],30,mysql_GetString("factions", "Rang2", "ID", string));
format(TeamInfo[i][Rang3],30,mysql_GetString("factions", "Rang3", "ID", string));
format(TeamInfo[i][Rang4],30,mysql_GetString("factions", "Rang4", "ID", string));
format(TeamInfo[i][Rang5],30,mysql_GetString("factions", "Rang5", "ID", string));
format(TeamInfo[i][Rang6],30,mysql_GetString("factions", "Rang6", "ID", string));
format(TeamInfo[i][Rang7],30,mysql_GetString("factions", "Rang7", "ID", string));
format(TeamInfo[i][Rang8],30,mysql_GetString("factions", "Rang8", "ID", string));
format(TeamInfo[i][Rang9],30,mysql_GetString("factions", "Rang9", "ID", string));
format(TeamInfo[i][Rang10],30,mysql_GetString("factions", "Rang10", "ID", string));
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt1", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt2", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt3", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt4", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt5", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt6", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt7", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt8", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt9", "ID", string);
TeamInfo[i][fGehalt]= mysql_GetInt("factions", "Gehalt10", "ID", string);
}
return 1;
}
stock SaveKassen()
{
new string[3],query0[500],query1[500],query2[500],query3[1500];
for(new i=0; i < MAX_FRAKTION; i++)
{
format(string, sizeof string, "%d", i);
format(query0, sizeof(query0), "UPDATE `factions` SET `Geld` = '%i',`Skin1` = '%i',`Skin2` = '%i',`Skin3` = '%i',`Skin4` = '%i',`Skin5` = '%i',`Skin6` = '%i',`Skin7` = '%i',`Skin8` = '%i',`Skin9` = '%i',`Skin10` = '%i',",
TeamInfo[i][fKasse],TeamInfo[i][Skin1],TeamInfo[i][Skin2],TeamInfo[i][Skin3],TeamInfo[i][Skin4],TeamInfo[i][Skin5],TeamInfo[i][Skin6],TeamInfo[i][Skin7],TeamInfo[i][Skin8],TeamInfo[i][Skin9],TeamInfo[i][Skin10]);
format(query1, sizeof(query1), "`Rang1` = '%s',`Rang2` = '%s',`Rang3` = '%s',`Rang4` = '%s',`Rang5` = '%s',`Rang6` = '%i',`Rang7` = '%s',`Rang8` = '%s',`Rang9` = '%s',`Rang10` = '%s',",
TeamInfo[i][Rang1],TeamInfo[i][Rang2],TeamInfo[i][Rang3],TeamInfo[i][Rang4],TeamInfo[i][Rang5],TeamInfo[i][Rang6],TeamInfo[i][Rang7],TeamInfo[i][Rang8],TeamInfo[i][Rang9],TeamInfo[i][Rang10]);
format(query2, sizeof(query2), "`Gehalt1` = '%i',`Gehalt2` = '%i',`Gehalt3` = '%i',`Gehalt4` = '%i',`Gehalt5` = '%i',`Gehalt6` = '%i',`Gehalt7` = '%i',`Gehalt8` = '%i',`Gehalt9` = '%i',`Gehalt10` = '%i'WHERE `ID` = '%s'",
TeamInfo[i][Gehalt1],TeamInfo[i][Gehalt2],TeamInfo[i][Gehalt3],TeamInfo[i][Gehalt4],TeamInfo[i][Gehalt5],TeamInfo[i][Gehalt6],TeamInfo[i][Gehalt7],TeamInfo[i][Gehalt8],TeamInfo[i][Gehalt9],TeamInfo[i][Gehalt10],string);
format(query3, sizeof(query3),"%s%s%s",query0,query1,query2);
mysql_query(query3);
print(query3);
//mysql_SetInt("factions", "Geld",TeamInfo[i][pKasse], "ID", string);
}
return 1;
}