Hallo,
Ich könnte dringends hilfe gebrauchen, könnte mir dies einer von Mysql auf Dini umschreiben?
public SaveGangWarInfos()
{
new string[128];
for(new i = 0; i < sizeof(GangWarSystemInfo); i++)
{
format(string, sizeof(string), "SELECT * FROM `gangwars` WHERE `GangWarID` = '%d'", i);
self_mysql_query(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) == 0)
{
format(string, sizeof(string), "INSERT INTO `gangwars` (`GangWarID`) VALUES ('%d')", i);
self_mysql_query(string);
}
mysql_free_result(MySQLConnection);
new var[526];
format(var, sizeof(var), "UPDATE `gangwars` SET `GWActive`='%d', `GWTeam1ID`='%d', `GWTeam2ID`='%d', `GWTeam1Points`='%d', `GWTeam2Points`='%d', `GWErsteller`='%d', `GWGrund`='%s' WHERE `GangWarID`='%d'",
GangWarSystemInfo[i][GWActive],
GangWarSystemInfo[i][GWTeam1ID],
GangWarSystemInfo[i][GWTeam2ID],
GangWarSystemInfo[i][GWTeam1Points],
GangWarSystemInfo[i][GWTeam2Points],
GangWarSystemInfo[i][GWErsteller],
GangWarSystemInfo[i][GWReason],
i);
self_mysql_query(var);
}
return 1;
}
public LoadGangWarInfos()
{
new string[128];
for(new i = 0; i < sizeof(GangWarSystemInfo); i++)
{
GangWarSystemInfo[i][GWActive] = 0;
GangWarSystemInfo[i][GWTeam1ID] = -1;
GangWarSystemInfo[i][GWTeam2ID] = -1;
GangWarSystemInfo[i][GWTeam1Points] = 0;
GangWarSystemInfo[i][GWTeam2Points] = 0;
strmid(GangWarSystemInfo[i][GWReason], "Kein Grund Angegeben", 0, strlen("Kein Grund Angegeben"), 255);
format(string, sizeof(string),"SELECT * FROM `gangwars` WHERE `GangWarID` = '%d'", i);
self_mysql_query(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("GWActive", val); GangWarSystemInfo[i][GWActive] = strval( val );
self_mysql_get_field("GWTeam1ID", val); GangWarSystemInfo[i][GWTeam1ID] = strval( val );
self_mysql_get_field("GWTeam2ID", val); GangWarSystemInfo[i][GWTeam2ID] = strval( val );
self_mysql_get_field("GWTeam1Points", val); GangWarSystemInfo[i][GWTeam1Points] = strval( val );
self_mysql_get_field("GWTeam2Points", val); GangWarSystemInfo[i][GWTeam2Points] = strval( val );
self_mysql_get_field("GWErsteller", val); GangWarSystemInfo[i][GWErsteller] = strval( val );
self_mysql_get_field("GWGrund", val); strmid(GangWarSystemInfo[i][GWReason], val, 0, strlen(val), 255);
}
mysql_free_result(MySQLConnection);
}
print("Gangwars geladen");
return 1;
}
Würde mich sehr freuen