CMD:register(playerid, params[]) { if(pInfo[playerid][pLogged] == 1){return 1;} if(pHaveAcc[playerid] == 1){return 1;} if(isnull(params)){return SendClientMessage(playerid, COLOR_GREY, "Please num /register [password]");} new query[1024]; new sqlusername[64]; new sqlpassword[512]; mysql_real_escape_string(GetName(playerid), sqlusername); mysql_real_escape_string(params, sqlpassword); format(query, sizeof(query), "INSERT INTO `accounts` (name, password, skin, level, moneys, team, rank,\ job, mats, drugs, driving, flying, sailling, weapons, health, armour, wanted, jailed, jailtime,\ spawnx, spawny, spawnz, interior, weapon1, weapon2, weapon3, weapon4) VALUES ('%s', MD5('%s'),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)", sqlusername,sqlpassword); mysql_query(query); pInfo[playerid][pLogged] = 1; SpawnPlayer(playerid); new string[128]; format(string,sizeof(string),"%s you can login on!",GetName(playerid)); SendClientMessage(playerid,COLOR_BLUE,string); return 1; }
maybe create the table called "accounts" in the MySQL database?
|
[16:23:54] [16:23:54] --------------------------- [16:23:54] MySQL Debugging activated (06/19/11) [16:23:54] --------------------------- [16:23:54] [16:24:18] >> mysql_query( Connection handle: 1 ) [16:24:18] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `name` = 'Vivian_Kris') - Successfully executed. [16:24:18] >> mysql_store_result( Connection handle: 1 ) [16:24:18] CMySQLHandler::StoreResult() - Result was stored. [16:24:18] >> mysql_free_result( Connection handle: 1 ) [16:24:18] CMySQLHandler::FreeResult() - Result was successfully free'd. [16:24:18] >> mysql_num_rows( Connection handle: 1 ) [16:24:18] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [16:26:13] >> mysql_real_escape_string( Connection handle: 1 ) [16:26:13] CMySQLHandler::EscapeString(Vivian_Kris); - Escaped 11 characters to Vivian_Kris. [16:26:13] >> mysql_real_escape_string( Connection handle: 1 ) [16:26:13] CMySQLHandler::EscapeString(luxingg); - Escaped 7 characters to luxingg. [16:26:13] >> mysql_query( Connection handle: 1 ) [16:26:13] CMySQLHandler::Query(INSERT INTO `accounts` (`name`, `password`, `skin`, `level`, `moneys`, `team`, `rank`,`job`, `mats`, `drugs`, `driving`, `flying`, `sailling`, `weapons`, `health`, `armour`, `wanted`, `jailed`, `jailtime`,`spawnx`, `spawny`, `spawnz`, `interior`, `weapon1`, `weapon2, `weapon3`, `weapon4`) VALUES ('Vivian_Kris', MD5('luxingg'),'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0')) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'weapon3`, `weapon4`) VALUES ('Vivian_Kris', MD5('luxingg'),'0','0','0','0','0','' at line 1)
Your MySQL log: An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'weapon3`, `weapon4`) VALUES ('Vivian_Kris', MD5('luxingg'),'0','0','0','0','0','' at line 1).
You forgot to add ` after weapon2. |