Hallo an alle die dies lesen,
Ich habe folgendes Problem :
Wenn ich Ingame mir ein Auto beim Autohaus kaufe geht zwar alles, aber wenn ich reloagen möchte kommt beim Game-start kein Loginfenster mehr.
Ich habe schon semtliche sachen ausprobiert, aber nichts hilft.
Ich hoffe mir kann jemand weiterhelfen
Hier die PWN-Code :
Register/Login Dialog
if(dialogid == DIALOG_LOGIN)
{
if(response && strlen(inputtext) > 0)
{
OnPlayerLogin(playerid,inputtext);
LoginTextForPlayer(playerid, 0);
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Willkommen
auf Arcticbytes Reallife,\nbitte Logge dich nun
ein!\n","Login","Abbrechen");
}
}
if(dialogid == DIALOG_REG)
{
if(response)
{
ShowPlayerDialog(playerid,DIALOG_REG2,DIALOG_STYLE_PASSWORD,"Account
erstellen","Gib das Passwort für deinen Account ein:","OK","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_MSGBOX,"Account","Du
benötigst einen Account, um auf Arcticbytes Reallife zu
spielen!","Erstellen","Abbrechen");
}
}
if(dialogid == DIALOG_REG2)
{
if(response && strlen(inputtext) > 0)
{
OnPlayerRegister(playerid,inputtext);
}
else
{
ShowPlayerDialog(playerid,DIALOG_REG2,DIALOG_STYLE_PASSWORD,"Account
erstellen","Gib das Passwort für deinen Account ein:","OK","Abbrechen");
}
}
Autohaus-System
Function OnPlayerBuyCar(playerid,Model,preis,Autohaus)//CARSYS
{
if(IsPlayerConnected(playerid) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "*Du hast dir ein Auto gekauft.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Gehe zu der KFZ Stelle und hole dir ein Kennzeichen.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Fahre vorsichtig..Und denk an die StraßenVerkehrsOrdnung!");
SendClientMessage(playerid, COLOR_LIGHTRED, "*ACHTUNG: Wenn du dein Auto parkst wirst du vom System gekickt und musst dich neu einloggen!");
GivePlayerMoney(playerid, -preis);
PlayerInfo[playerid][pCash] -= preis;
SetParkPlatz(playerid,Autohaus);
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof name);
format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
new File: hFile = fopen(str, io_write);
if (hFile)
{
new var[32];
format(var, 32, "CarId=0\n");fwrite(hFile, var);
format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
format(var, 32, "CarFB=0\n");fwrite(hFile, var);
format(var, 32, "CarRB=0\n");fwrite(hFile, var);
format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
format(var, 32, "CarHood=0\n");fwrite(hFile, var);
format(var, 32, "CarVents=0\n");fwrite(hFile, var);
format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
format(var, 32, "Preis=%d\n",preis);fwrite(hFile, var);
format(var, 32, "Plate=XXX\n");fwrite(hFile, var);
fclose(hFile);
}
OnPlayerCarLogin(playerid);
}
}
Function OnPlayerCarLogin(playerid)
{
for(new x = 0; x < MaxVeh; x++)
{
if(!Dtc_PlayerHaveCar[playerid][x])
{
new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "/Autos/%s%d.dtcar", playername2,x);
new File: UserFile = fopen(string2, io_read);
if (UserFile)
{
Dtc_PlayerHaveCar[playerid][x] = 1;
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "CarId" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarId] = strval( val ); }
if( strcmp( key , "CarModel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarModel] = strval( val ); }
if( strcmp( key , "CarPos_x" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_x] = floatstr( val ); }
if( strcmp( key , "CarPos_y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_y] = floatstr( val ); }
if( strcmp( key , "CarPos_z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_z] = floatstr( val ); }
if( strcmp( key , "CarRotate" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRotate] = floatstr( val ); }
if( strcmp( key , "CarNitro" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarNitro] = strval( val ); }
if( strcmp( key , "CarHyd" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHyd] = strval( val ); }
if( strcmp( key , "CarWheel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarWheel] = strval( val ); }
if( strcmp( key , "CarAusp" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarAusp] = strval( val ); }
if( strcmp( key , "CarSideL" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideL] = strval( val ); }
if( strcmp( key , "CarSideR" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideR] = strval( val ); }
if( strcmp( key , "CarFB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarFB] = strval( val ); }
if( strcmp( key , "CarRB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRB] = strval( val ); }
if( strcmp( key , "CarSpoiler" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSpoiler] = strval( val ); }
if( strcmp( key , "CarRoof" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRoof] = strval( val ); }
if( strcmp( key , "CarHood" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHood] = strval( val ); }
if( strcmp( key , "CarVents" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarVents] = strval( val ); }
if( strcmp( key , "CarLamps" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarLamps] = strval( val ); }
if( strcmp( key , "CarPJ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPJ] = strval( val ); }
if( strcmp( key , "CarC1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC1] = strval( val ); }
if( strcmp( key , "CarC2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC2] = strval( val ); }
if( strcmp( key , "Preis" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPreis] = strval( val ); }
if( strcmp( key , "Plate" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][Plate] = strval( val ); }
}
fclose(UserFile);
PlayerCarSpawn(playerid,x);
}
}
}
}
falls euch noch etwas einfällt, bitte bescheit geben.
falls Ihr noch einen Script-Teil braucht, einfach bescheit geben.
Danke an alle die mir versuchen zu helfen und an die die es schaffen ;).
mfg
wurzelsep96