06.12.2011, 05:34
pawn Код:
stock SaveAccount(playerid)
{
if(PlayerInfo[playerid][pLogged] == true)
{
CheckMySQLConnection();
new sqlname[MAX_PLAYER_NAME], sqlpass[64], string[800];
mysql_real_escape_string(PlayerInfo[playerid][pName], sqlname);
mysql_real_escape_string(PlayerInfo[playerid][pPassword], sqlpass);
strcat(string, "UPDATE `Accounts` SET `NickName`='%s', `Password`='%s', `Skin`=%i, `Admin`=%i, `Ban`=%i, `Warn`=%i, `Money`=%i, `Muted`=%i, `MuteTime`=%i", sizeof(string));
strcat(string, ", `Level`=%i, `Member`=%i, `Leader`=%i, `Rank`=%i, `FSkin`=%i, `Prova`=%i, `Moto`=%i, `Lodka`=%i, `Avia`=%i WHERE `ID`=%i", sizeof(string));
format(
string,
sizeof(string),
string,
sqlname,
sqlpass,
PlayerInfo[playerid][pSkin],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pBanned],
PlayerInfo[playerid][pWarns],
PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pMuted],
PlayerInfo[playerid][pMuteTime],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pMember],
PlayerInfo[playerid][pLeader],
PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pFSkin],
PlayerInfo[playerid][pProva],
PlayerInfo[playerid][pMoto],
PlayerInfo[playerid][pLodka],
PlayerInfo[playerid][pAvia],
PlayerInfo[playerid][pID]
);
mysql_query(string);
}
return 1;
}