07.11.2010, 00:36
anyhelp?
stock SavePlayerAccount(playerid)
{
if(IsLogged[playerid] == 1)
{
print("Start Saving Player Accounts..");
new Escape[1][MAX_PLAYER_NAME];
mysql_real_escape_string(Playername(playerid), Escape[0]);
new Query[1024];
format(Query, sizeof(Query),"UPDATE `Accounts` SET `AdminLevel`=%d,`DonaterRank`=%d,`Money`=%d,`Score`=%d,`Kills`=%d,`Deaths`=%d,`WantedLevel`=%d,`DrunkLevel`=%d,`FightingStyle`=%d,`RobSkill`=%d,`Seconds`=%d,`Minutes`=%d,`Hours`=%d,`Days`=%d,`CopSkill`=%d,`Regular`=%d,`Tickets`=%d,`TicketsCollected`=%d,`Arrests`=%d,`Bank`=%d,`PayDays`=%d,`PayChecks`=%d,`DrugSeeds`=%d,`Weed`=%d,`LastCrime1`='%s',`LastCrime2`='%s',`LastCrime3`='%s',`LastCrime4`='%s',`LastCrime5`='%s'",
PlayerInfo[playerid][AdminLevel],PlayerInfo[playerid][pDonaterRank],
PlayerInfo[playerid][Money],GetPlayerScore(playerid),PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths],
GetPlayerWantedLevel(playerid),GetPlayerDrunkLevel(playerid),GetPlayerFightingStyle(playerid),
PlayerInfo[playerid][RobSkill],LoggedSeconds[playerid],LoggedMinutes[playerid],LoggedHours[playerid],LoggedDays[playerid],
PlayerInfo[playerid][pRegular],PlayerInfo[playerid][CopSkill],PlayerInfo[playerid][Tickets],PlayerInfo[playerid][TicketsCollected],PlayerInfo[playerid][Arrests],
PlayerInfo[playerid][pBank],PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayCheck],
PlayerInfo[playerid][Seeds],PlayerInfo[playerid][WeedAmount],PlayerInfo[playerid][LastCrime1],PlayerInfo[playerid][LastCrime2],
PlayerInfo[playerid][LastCrime3],PlayerInfo[playerid][LastCrime4],PlayerInfo[playerid][LastCrime5]);
format(GlobalQuery, sizeof(GlobalQuery),"%s, `Condoms` = %d,`Wallets`=%d,`C4s`=%d,`Gang`='%s',`Gangid`=%d,`Mafia`=%d,`Swat`=%d,`LifeInsurance`=%d,`HealthInsurance`=%d WHERE Username = '%s' LIMIT 1",
Query,PlayerInfo[playerid][Condoms],PlayerInfo[playerid][Wallets],PlayerInfo[playerid][C4s],
PlayerInfo[playerid][Gang],PlayerInfo[playerid][Gangid],PlayerInfo[playerid][MafiaMember],PlayerInfo[playerid][SwatMember],
PlayerInfo[playerid][LifeInsurance],PlayerInfo[playerid][HealthInsurance],Escape[0]);
mysql_query(GlobalQuery);
print("Finished Saving Player Accounts..");
//print(GlobalQuery);
}
return 1;
}
public SavePlayerTimer()
{
foreach(Player,i)
{
SavePlayerAccount(i);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SavePlayerAccount(playerid);