17.08.2015, 16:56
I have a stock to save the player account
Код:
stock SavePlayer(playerid) { new query[356], EncryptedPass[130]; WP_Hash(EncryptedPass, sizeof(EncryptedPass), Player[playerid][pPassword]); GetPlayerPos(playerid, Player[playerid][pPosition][0], Player[playerid][pPosition][1], Player[playerid][pPosition][2]); format(query, sizeof(query), "UPDATE accounts SET pName = '%s', pPassword = '%s', pAdminLevel = %d, pPlayerPos = '%f %f %f', pSkin=%d, pMoney = %d, pVip = %d, pMuted = %d, pWarnings = %d, pWarningReasons = '%s|%s|%s', pLevel = %d, pExp = %d WHERE pid = %d", GetName(playerid), Player[playerid][pPassword], Player[playerid][pAdminLevel], Player[playerid][pPosition][0], Player[playerid][pPosition][1], Player[playerid][pPosition][0], Player[playerid][pSkin], Player[playerid][pMoney], Player[playerid][pvStatus], Player[playerid][pMuted], Player[playerid][pWarnings], Player[playerid][pWarningReason1], Player[playerid][pWarningReason2], Player[playerid][pWarningReason3], Player[playerid][pLevel], Player[playerid][pExp], Player[playerid][pID]); mysql_query(query); printf(query); printf("Player ID %d (%s) has been saved", playerid, GetName(playerid)); }