MySQL - no errors but it doesn't save - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL - no errors but it doesn't save (
/showthread.php?tid=481591)
MySQL - no errors but it doesn't save -
Tagathron - 16.12.2013
Im just trying to make a simpe VIP system,but when i relog i do not have VIP even though i gave it to myself-when i test.
Here's some of the /givevip command:
pawn Код:
if(sscanf(params, "ui", targetP, vipLevel)) return SendClientMessage(playerid, COLOR_GREY, "USAGE:/givevip [PLAYER ID] [VIP LEVEL]");
playerVariables[targetP][pVIP]=vipLevel;
GetPlayerName(playerid, admName, sizeof(admName));
GetPlayerName(targetP, targetPName, sizeof(targetPName));
format(msgToA, sizeof(msgToA), "You have given VIP level %d to player %s", vipLevel, targetPName);
format(msgToP, sizeof(msgToP), "You have been given VIP level %d", vipLevel);
SendClientMessage(playerid, COLOR_YELLOW, msgToA);
SendClientMessage(targetP, COLOR_YELLOW, msgToP);
And here are the lines for MySQL query,to save and get the VIP variable value:
pawn Код:
mysql_get_field("playerVIP", result);
playerVariables[extraid][pVIP] = strval(result);
and
pawn Код:
format(saveQuery, sizeof(saveQuery), "%s playerVIP = 'd'", saveQuery, playerVariables[playerid][pVIP]);
mysql_query(saveQuery);
Re: MySQL - no errors but it doesn't save -
Brandon_More - 16.12.2013
pawn Код:
new pname[24];
GetPlayerName(playerid, pname, sizeof(pname));
pawn Код:
format(saveQuery, sizeof(saveQuery), "UPDATE Players SET playerVIP=%d WHERE user='%s'", PlayerInfo[playerid][pVIP], pname);
mysql_query(SaveQuery);
Re: MySQL - no errors but it doesn't save -
Tagathron - 16.12.2013
Quote:
Originally Posted by Brandon_More
pawn Код:
new pname[24]; GetPlayerName(playerid, pname, sizeof(pname));
pawn Код:
format(saveQuery, sizeof(saveQuery), "UPDATE Players SET playerVIP=%d WHERE user='%s'", PlayerInfo[playerid][pVIP], pname); mysql_query(SaveQuery);
|
Nah there's this one query string with more queries formatted in it.
only thing that doesn't save is VIP,no idea why.
I think i found the bug,i appreciate your help man anyways.