CMD:makevip(playerid, params[]) { if(Player[playerid][pAdminLevel] >= 3) { new id, level, string[126]; if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Syntax: /makevip [playerid] [level]"); Player[id][pvStatus] = level; format(string, sizeof(string), "%s has made you a VIP level %d", GetNameEx(playerid), level); SendClientMessage(id, -1, string); format(string, sizeof(string), "You have made %s a VIP level %d", GetNameEx(id), level); SendClientMessage(playerid, -1, string); } return 1; }
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', pMoney = %d, pVip = %d, pMuted = %d, pWarnings = %d, pWarningReasons = '%s|%s|%s' 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][pID]); mysql_query(query); printf("Player ID %d (%s) has been saved", playerid, GetName(playerid)); }
I've made an vip system on an MySQL server made by me and when i give someone the vip it doesn't save
Command: Код:
CMD:makevip(playerid, params[]) { if(Player[playerid][pAdminLevel] >= 3) { new id, level, string[126]; if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Syntax: /makevip [playerid] [level]"); Player[id][pvStatus] = level; format(string, sizeof(string), "%s has made you a VIP level %d", GetNameEx(playerid), level); SendClientMessage(id, -1, string); format(string, sizeof(string), "You have made %s a VIP level %d", GetNameEx(id), level); SendClientMessage(playerid, -1, string); } return 1; } Код:
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', pMoney = %d, pVip = %d, pMuted = %d, pWarnings = %d, pWarningReasons = '%s|%s|%s' 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][pID]); mysql_query(query); printf("Player ID %d (%s) has been saved", playerid, GetName(playerid)); } https://sampforum.blast.hk/showthread.php?tid=122983 |
mysql_query(query);
printf(query);
"UPDATE accounts SET pName = '%s', pPassword = '%s', pAdminLevel = %d, pPlayerPos = '%f %f %f', pMoney = %d, pVip = %d, pMuted = %d, pWarnings = %d, pWarningReasons = '%s|%s|%s' 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][pID]