public OnAccountLoad(playerid) { PlayerInfo[playerid][Score] = cache_get_field_content_int(0, "Score"); PlayerInfo[playerid][Cash] = cache_get_field_content_int(0, "Cash"); PlayerInfo[playerid][Level] = cache_get_field_content_int(0, "Level"); PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills"); PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths"); PlayerInfo[playerid][pMute] = cache_get_field_content_int(0, "pMute"); PlayerInfo[playerid][Warns] = cache_get_field_content_int(0, "Warns"); GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]); SetPlayerScore(playerid, PlayerInfo[playerid][Score]); JustLogged[playerid] = 1; Logged[playerid] = 1; SendClientMessage(playerid, COLOR_RED, "{FF0000}[UF] {BDBDBD}» {fde2c3}You have been successfully {00FF00}Logged-In!"); return 1; }
[16:25:25] [DEBUG] mysql_format - connection: 1, len: 300, format: "UPDATE `Accounts` SET Score=%d, Cash=%d, Level=%d, Kills=%d, Deaths=%d, muted=%d, Warns=%d WHERE Name='%s'" [16:25:25] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `Accounts` SET Score=2, Cash=49540, Level=0, Kills=0, Dea", callback: "(null)", format: "(null)" [16:25:25] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [16:25:25] [DEBUG] mysql_tquery - scheduling query "UPDATE `Accounts` SET Score=2, Cash=49540, Level=0, Kills=0, Deaths=0, muted=0, Warns=0 WHERE Name='sptzodric'".. [16:25:25] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [16:25:25] [DEBUG] CMySQLQuery::Execute[()] - query was successful [16:25:25] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving [16:25:25] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks() [16:25:25] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
case DIALOG_REGISTER: { new pname[24], plIP[15]; GetPlayerName(playerid, pname, 24); GetPlayerIp(playerid, plIP, 15); if(!response) return Kick(playerid); if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "In order to play, you need to register.\nYour password must be at least 6 characters long!", "Register", "Quit"); new query[300]; WP_Hash(PlayerInfo[playerid][Password], 129, inputtext); mysql_format(mysql, query, sizeof(query), "INSERT INTO `Accounts` (`Name`, `Password`, `RegisterDate`, `IP`) VALUES('%s', '%s', NOW(), '%s')", pname, PlayerInfo[playerid][Password], plIP); mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid); Logged[playerid] = 1; }
You have to use SELECT query in function mysql_query
I prefer to use normal MySQL functions - mysql_query, mysql_store_result, mysql_fetch_row - I am using them in my gamemode and works fine |