public OnPasswordResponse(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
//Passwort richtig
pInfo[playerid][eingeloggt] = 1;
pInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
SetPlayerScore(playerid,pInfo[playerid][level]);
pInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
pInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
SetPlayerHealth(playerid,cache_get_field_content_float(0,"health",dbhandle));
pInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
pInfo[playerid][frang] = cache_get_field_content_int(0,"frang",dbhandle);
pInfo[playerid][spawnchange] = cache_get_field_content_int(0,"spawnchange",dbhandle);
loadPlayerCars(playerid);
SpawnPlayer(playerid);
}
else
{
//Passwort falsch
SendClientMessage(playerid,COLOR_RED,"Das eingegebene Passwort war falsch. Bitte versuche es erneut.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gib bitte dein Passwort ein:","Login","Abbrechen");
}
return 1;
}
savePlayer(playerid)
{
if(pInfo[playerid][eingeloggt]==0)return 1;
new query[256], Float:healt;
GetPlayerHealth(playerid, healt);
format(query,sizeof(query),"UPDATE user SET level='%i',money='%i', alevel='%i', health='%f', fraktion='%i', frang='%i', spawnchange='%i', banned='%i' WHERE id='%i'",pInfo[playerid][level],GetPlayerMoney(playerid),pInfo[playerid][alevel],healt,pInfo[playerid][fraktion],pInfo[playerid][frang],pInfo[playerid][spawnchange],pInfo[playerid][banned],pInfo[playerid][db_id]);
mysql_function_query(dbhandle,query,false,"","");
return 1;
}
GESPEICHERT WIRD ER! Aber er wird dann beim einloggen wieder überschrieben!
Kann mir keiner helfen?!?!?!?