[17:15:02] [plugins/mysql] cache_get_value_name_int: value 'lol' is not a number
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `SCORE`= %i , `Admin` = '%i' , `personalmsg` = '%e' WHERE `ID` = '%d'", GetPlayerScore(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][personalmsg], PlayerInfo[playerid][ID]);
UPDATE `accounts` SET `personalmsg` = 'lol' WHERE `accounts`.`ID` = 3;
[17:15:02] [plugins/mysql] cache_get_value_name_int: value 'lol' is not a number
mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `personalmsg`, `Admin`, `Money`) VALUES ('%e', '%e', '%e', 0, 0,'%e')", Name[playerid], PlayerInfo[playerid][Password], IP[playerid], PlayerInfo[playerid][personalmsg]);
forward OnAccountLoad(playerid); public OnAccountLoad(playerid) { cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][pAdmin]); cache_get_value_name_int(0, "Score", PlayerInfo[playerid][Score]); cache_get_value_name_int(0, "personalmsg", PlayerInfo[playerid][personalmsg]); GivePlayerMoney(playerid, PlayerInfo[playerid][Money]); SetPlayerScore(playerid, PlayerInfo[playerid][Score]); return true; }
cache_get_value_name(0, "personalmsg", PlayerInfo[playerid][personalmsg]);
cache_get_value_name(0, "personalmsg", PlayerInfo[playerid][personalmsg], length of personalmsg here);
You need to put string length at 4th parameter, as 'personalmsg' is an enum.
Код:
cache_get_value_name(0, "personalmsg", PlayerInfo[playerid][personalmsg], length of personalmsg here); |
enum pInfo { pAdmin, pWork, StartingPoint, EndingPoint, pConvoy, MissionID, ID, Password[129], Score, Money, personalmsg[129], } new PlayerInfo[MAX_PLAYERS][pInfo];