Hallo Community,
also, erstens,
wenn ich ein Zweites Fahrzeug createn will dann erscheint es nicht, aber speichert sich in der Datenbank.. das ist der Code vom erstellen:
PHP
if(dialogid == DIALOG_AUTOHAUS3)
{
if(response)
{
new Float:carpreis;
carpreis = floatstr(inputtext);
if(carpreis > 0.00)
{
new Float:xpos,Float:ypos,Float:zpos,Float:apos;
AInfo[Fahrzeugauto[playerid]][fahrzeugpreis] = carpreis;
GetPlayerPos(playerid,xpos,ypos,zpos);
GetPlayerFacingAngle(playerid,apos);
AInfo[Fahrzeugauto[playerid]][aposx] = xpos;
AInfo[Fahrzeugauto[playerid]][aposy] = ypos;
AInfo[Fahrzeugauto[playerid]][aposz] = zpos;
AInfo[Fahrzeugauto[playerid]][aposa] = apos;
SendClientMessage(playerid,COLOR_GRUN,"Fahrzeug umparken: Verwende /acar, benutze aber erst den A-Dienst!");
SaveAutohaus2(Fahrzeugauto[playerid]);
LoadAutohaus2(Fahrzeugauto[playerid]);
Fahrzeugauto[playerid] = -1;
}
else{
ShowPlayerDialog(playerid,DIALOG_AUTOHAUS3,DIALOG_STYLE_INPUT,"Autohaus","Der Preis muss über 0.00 $ sein!\n\nGebe hier bitte den Preis für das Fahrzeug ein:","Erstellen","Erstellen");
}
}
}
Alles anzeigen
Code
stock LoadAutohaus2(i)
{
new var[256],var2[128];
format(var2, sizeof(var2),"SELECT * FROM `autohaus` WHERE `dataid` = '%d'", i);
self_mysql_queryEx(var2);
mysql_store_result();
while(mysql_fetch_row_format(var2,"|"))
{
mysql_get_field("dataid",var); AInfo[i][dataid] = strval(var);
mysql_get_field("fahrzeugid",var); AInfo[i][dataid] = strval(var);
mysql_get_field("fahrzeugpreis",var); AInfo[i][fahrzeugpreis] = floatstr(var);
mysql_get_field("aposx",var); AInfo[i][aposx] = floatstr(var);
mysql_get_field("aposy",var); AInfo[i][aposy] = floatstr(var);
mysql_get_field("aposz",var); AInfo[i][aposz] = floatstr(var);
mysql_get_field("aposa",var); AInfo[i][aposa] = floatstr(var);
AInfo[i][fahrzeugerstellt] = CreateDynamicVehicle(AInfo[i][fahrzeugid],AInfo[i][aposx],AInfo[i][aposy],AInfo[i][aposz],AInfo[i][aposa],-1,-1,10000,0,0,0,50);
}
return 1;
}
Alles anzeigen
So und zweitens:
Wenn ich den Server neustarte createn sich die Fahrzeuge nicht....
Sie werden geladen aber es wird keins erstellt:
Code
stock LoadAutohaus(){
for(new i=0; i<MAX_AUTOHAUSCA; i++)
{
new var[256],var2[128];
format(var2, sizeof(var2),"SELECT * FROM `autohaus` WHERE `dataid` = '%d'", i);
self_mysql_queryEx(var2);
mysql_store_result();
while(mysql_fetch_row_format(var2,"|")){
mysql_get_field("dataid",var); AInfo[i][dataid] = strval(var);
mysql_get_field("fahrzeugid",var); AInfo[i][dataid] = strval(var);
mysql_get_field("fahrzeugpreis",var); AInfo[i][fahrzeugpreis] = floatstr(var);
mysql_get_field("aposx",var); AInfo[i][aposx] = floatstr(var);
mysql_get_field("aposy",var); AInfo[i][aposy] = floatstr(var);
mysql_get_field("aposz",var); AInfo[i][aposz] = floatstr(var);
mysql_get_field("aposa",var); AInfo[i][aposa] = floatstr(var);
AInfo[i][fahrzeugerstellt] = CreateDynamicVehicle(AInfo[i][fahrzeugid],AInfo[i][aposx],AInfo[i][aposy],AInfo[i][aposz],AInfo[i][aposa],-1,-1,10000,0,0,0,50);
}
}
return 1;
}
Alles anzeigen
Code
[15:31:48] CMySQLHandler::Query(SELECT * FROM `autohaus` WHERE `dataid` = '1') - Successfully executed.
[15:31:48] >> mysql_store_result( Connection handle: 1 )
[15:31:48] CMySQLHandler::StoreResult() - Result was stored.
[15:31:48] >> mysql_fetch_row_format( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchRow() - Return: 1|541|9000|6333.74|-8289.94|4.21|192.57
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("dataid") - 1
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("fahrzeugid") - 541
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("fahrzeugpreis") - 9000
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposx") - 6333.74
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposy") - -8289.94
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposz") - 4.21
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposa") - 192.57
[15:31:48] >> mysql_fetch_row_format( Connection handle: 1 )
[15:31:48] >> mysql_query( Connection handle: 1 )
[15:31:48] CMySQLHandler::Query(SELECT * FROM `autohaus` WHERE `dataid` = '2') - Successfully executed.
[15:31:48] >> mysql_store_result( Connection handle: 1 )
[15:31:48] CMySQLHandler::StoreResult() - Result was stored.
[15:31:48] >> mysql_fetch_row_format( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchRow() - Return: 2|520|1|6333.12|-8261.74|4.21|135.44
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("dataid") - 2
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("fahrzeugid") - 520
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("fahrzeugpreis") - 1
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposx") - 6333.12
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposy") - -8261.74
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposz") - 4.21
[15:31:48] >> mysql_fetch_field_row( Connection handle: 1 )
[15:31:48] CMySQLHandler::FetchField("aposa") - 135.44
[15:31:48] >> mysql_fetch_row_format( Connection handle: 1 )
[15:31:48] >> mysql_query( Connection handle: 1 )
Alles anzeigen
Bitte um hilfe
MfG
Moritz