05.03.2018, 18:05
Hi. My command won't change the value in mysql. I have a textdraw and it shows my money
This is the admin command
bUt it won't save to the mysql the new data. why? I type /setmoney x 1000 but in mysql it still remains 0.
mysql cmd
and
ex: In game i write 500 but in mysql it remains 0.
Код HTML:
format(strupdate,sizeof(strupdate),"Blood: %i~n~Temp: %0.2f F~n~Name: %s ~n~Money: %i USD", pInfo[i][pBlood],pInfo[i][pTemp],PlayerName(i),pInfo[i][pMoney]);
Код HTML:
CMD:setmoney(playerid,params[]) { if(pInfo[playerid][pAdminLevel] >= 5) { new targetid,money,string[128]; if(sscanf(params, "ui", targetid,money)) return SendClientMessage(playerid,-1,""chat" /setmoney [id] [value]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online"); format(string,sizeof(string),"*"COL_RED" %s %ssets %s money to %i USD", GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),money); SendMessageToAllAdmins(string,-1); format(string,sizeof(string),"*"COL_RED" %s %s has set ur money to %i USD",GetAdminName(playerid), PlayerName(playerid), money); SendClientMessage(targetid,-1,string); pInfo[targetid][pMoney] = money; } else { SendClientMessage(playerid,-1,"*"COL_RED" U no admin!"); } return 1; }
mysql cmd
Код HTML:
strcat(querystr,"CREATE TABLE IF NOT EXISTS `users` (`Username` varchar(24) NOT NULL,`Password` varchar(128) NOT NULL,`Headshots` int(11) NOT NULL,`Murders` int(11) NOT NULL,`BanditsKilled` int(11) NOT NULL,`ZombiesKilled` int(11) NOT NULL, `Backpack` int(11) NOT NULL,`BackpackSlots` int(11) NOT NULL,"); strcat(querystr,"`BackpackSlotsUsed` int(11) NOT NULL,`pAdminLevel` int(11) NOT NULL,`pVIP` int(11) NOT NULL,`pX` float NOT NULL,`pY` float NOT NULL,`pZ` float NOT NULL,`pWeap1` int(11) NOT NULL,`pAmmo1` int(11) NOT NULL,`pWeap2` int(11) NOT NULL,"); strcat(querystr,"`pAmmo2` int(11) NOT NULL,`pWeap3` int(11) NOT NULL,`pAmmo3` int(11) NOT NULL,`pWeap4` int(11) NOT NULL,`pAmmo4` int(11) NOT NULL,`pWeap5` int(11) NOT NULL,`pAmmo5` int(11) NOT NULL,`pWeap6` int(11) NOT NULL,`pAmmo6` int(11) NOT NULL,`pWeap7` int(11) NOT NULL,"); strcat(querystr,"`pAmmo7` int(11) NOT NULL,`pWeap8` int(11) NOT NULL,`pAmmo8` int(11) NOT NULL,`pWeap9` int(11) NOT NULL,`pAmmo9` int(11) NOT NULL,`pHour` int(11) NOT NULL,`pMin` int(11) NOT NULL,`pSec` int(11) NOT NULL,`pBlood` nt(11) NOT NULL,`pMoney` int(11) NOT NULL,`pThrist` int(11) NOT NULL,"); strcat(querystr,"`pHunger` int(11) NOT NULL,`Humanity` int(11) NOT NULL,`pFirstSpawn` int(11) NOT NULL,`pJailed` int(11) NOT NULL,`pAliveTime` int(11) NOT NULL,`pIsMapOpened` int(11) NOT NULL,`pSkin` int(11) NOT NULL,`Helper` int(11) NOT NULL, `Leader` int(11) NOT NULL,`IsPlayerBleeding` int(11) NOT NULL,"); strcat(querystr,"`IsPlayerLegBroken` int(11) NOT NULL,`pAmbientEnable` int(11) NOT NULL,`DefaultGender` int(11) NOT NULL, `IP` varchar(16) NOT NULL,`ID` int(11) NOT NULL)");
Код HTML:
enum playerinfo { pMoney ...