stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
GetPlayerName(playerid,PlayerInfo[playerid][pName],MAX_PLAYER_NAME);
if(r_LoadSQLEntrance("accounts","Name",PlayerInfo[playerid][pName]))
{
r_mysql_SetInt("Level",GetPlayerScore(playerid)); // X X
r_mysql_SetInt("Geld",GetPlayerMoney(playerid)); // X X
r_mysql_SetInt("Adminlevel",PlayerInfo[playerid][pAdmin]); // X
r_mysql_SetInt("Supporter",PlayerInfo[playerid][pSup]); // X
r_mysql_SetInt("Member",PlayerInfo[playerid][pMember]); // X
r_mysql_SetInt("Rang",GetPlayerSkin(playerid)); // X
r_mysql_SetInt("Skin",PlayerInfo[playerid][pSkin]); // X
r_mysql_SetInt("Morde",PlayerInfo[playerid][pKills]); // X
r_mysql_SetInt("Tode",PlayerInfo[playerid][pDeaths]); // X
r_mysql_SetInt("Bankgeld",PlayerInfo[playerid][Bank]); // X
r_mysql_SetInt("Respektpunkte",PlayerInfo[playerid][pRespekt]); // X
r_mysql_SetInt("PaydayTimer",PlayerInfo[playerid][pPayDayTimer]); // X
r_mysql_SetInt("PaydayLohn",PlayerInfo[playerid][pPayDayLohn]); // X
r_mysql_SetInt("FrakLohn",PlayerInfo[playerid][pPayDayFLohn]); // X
printf("Spielerdaten vom Spieler %s erfolgreich in der Datenbank gespeichert.",GetName(playerid));
r_UnloadSQLEntrance();
}
}
return 1;
}
stock LoadPlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
GivePlayerMoney(playerid, mysql_GetInt("accounts", "Geld", "Name", PlayerInfo[playerid][pName]));
SetPlayerScore(playerid, mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]));
SetPlayerSkin(playerid, mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]));
PlayerInfo[playerid][pAdmin] = r_mysql_GetInt("Adminlevel");
PlayerInfo[playerid][pSup] = r_mysql_GetInt("Supporter");
PlayerInfo[playerid][pMember] = r_mysql_GetInt("Member");
PlayerInfo[playerid][pRank] = r_mysql_GetInt("Rank");
PlayerInfo[playerid][pKills] = r_mysql_GetInt("Morde");
PlayerInfo[playerid][pDeaths] = r_mysql_GetInt("Tode");
PlayerInfo[playerid][Bank] = r_mysql_GetInt("Bankgeld");
PlayerInfo[playerid][pRespekt] = r_mysql_GetInt("Respektpunkte");
PlayerInfo[playerid][pPayDayTimer] = r_mysql_GetInt("PaydayTimer");
PlayerInfo[playerid][pPayDayLohn] = r_mysql_GetInt("PaydayLohn");
PlayerInfo[playerid][pPayDayFLohn] = r_mysql_GetInt("FrakLohn");
}
return 1;
}