Hey,
mein nächstes Problem..
Meine Daten werden immer falsch in meiner Tabelle abgespeichert, obwohl ich bei Registrieren alles auf 0 setze.
Hier mein Register Dialog:
case DIALOG_REGISTER1:
{
if(response)
{
if(strlen(MD5_Hash(inputtext)) == 0)
{
new string[300];
format(string,sizeof(string),"{FEFEFE}Willkommen auf {009BFF}New-Evolution-Reallife{FEFEFE}! Um auf diesem Server spielen zu können,\nmusst du dich nun registrieren. Dadurch erstellst du dir einen Eintrag in die\nDatenbank und kannst jederzeit auf dem Server joinen. {009BFF}Gib dein Passwort ein:");
ShowPlayerDialog(playerid,DIALOG_REGISTER1,DIALOG_STYLE_PASSWORD,"Registrieren",string,"Registrieren","Abbrechen");
return 1;
}
else
{
CreateAccount(playerid,MD5_Hash(inputtext));
StopAudioStreamForPlayer(playerid);
SetPVarInt(playerid,"Eingeloggt",1);
SetSpawnInfo(playerid,0,101,0,0,5,0,0,0,0,0,0,0);
SetPlayerMoney(playerid,0);
SetPlayerScore(playerid,1);
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][Revo] = 0;
SpawnPlayer(playerid);
SavePlayer(playerid);
return 1;
}
}
else
{
Kick(playerid);
}
}
{
if(response)
{
if(strlen(MD5_Hash(inputtext)) == 0)
{
new string[300];
format(string,sizeof(string),"{FEFEFE}Willkommen auf {009BFF}New-Evolution-Reallife{FEFEFE}! Um auf diesem Server spielen zu können,\nmusst du dich nun registrieren. Dadurch erstellst du dir einen Eintrag in die\nDatenbank und kannst jederzeit auf dem Server joinen. {009BFF}Gib dein Passwort ein:");
ShowPlayerDialog(playerid,DIALOG_REGISTER1,DIALOG_STYLE_PASSWORD,"Registrieren",string,"Registrieren","Abbrechen");
return 1;
}
else
{
CreateAccount(playerid,MD5_Hash(inputtext));
StopAudioStreamForPlayer(playerid);
SetPVarInt(playerid,"Eingeloggt",1);
SetSpawnInfo(playerid,0,101,0,0,5,0,0,0,0,0,0,0);
SetPlayerMoney(playerid,0);
SetPlayerScore(playerid,1);
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][Revo] = 0;
SpawnPlayer(playerid);
SavePlayer(playerid);
return 1;
}
}
else
{
Kick(playerid);
}
}
Und mein stock SavePlayer:
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
mysql_SetInt("accounts", "Geld", GetPlayerMoney(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Level", GetPlayerScore(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Adminlevel", PlayerInfo[playerid][pAdmin], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "RevolutionUser", PlayerInfo[playerid][Revo], "Name", PlayerInfo[playerid][pName]);
}
}
return 1;
}
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
mysql_SetInt("accounts", "Geld", GetPlayerMoney(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Level", GetPlayerScore(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Adminlevel", PlayerInfo[playerid][pAdmin], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "RevolutionUser", PlayerInfo[playerid][Revo], "Name", PlayerInfo[playerid][pName]);
}
}
return 1;
}
Die Tabelle sieht dann aber so aus;
[table='6']
[*]Name
[*]Passwort
[*]Geld
[*]Level
[*]AdminLevel
[*]RevolutionUser
[*]Narushi
[*]202CB962AC59075B964B07152D234B70
[*]-1
[*]-1
[*]-1
[*]-1
[/table]
//push oó