21.08.2011, 10:15
Hey,
Iam bussy with a gamemode (mysql)
but when somebody login, the server crash.
Log:
No mysql log,
its from crash detector plugin
Code:
its when a player login, they can register normal.
Structuur:
thanks!
Iam bussy with a gamemode (mysql)
but when somebody login, the server crash.
Log:
Quote:
The server has been crashed by native mysql_fetch_field_row at address 41ac in script gamemodes\RRP.amx. |
its from crash detector plugin
Code:
pawn Code:
stock MySQL_Login(playerid)
{
new query[300], pname[24], savingstring[20];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT * FROM users WHERE name = '%s' LIMIT 1", pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "level"); SetPlayerScore(playerid, strval(savingstring));
ResetPlayerMoney(playerid);
mysql_fetch_field_row(savingstring, "money"); GivePlayerMoney(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "Adminlevel"); Playerdata[playerid][Adminlevel] = strval(savingstring);
mysql_fetch_field_row(savingstring, "bank"); Playerdata[playerid][Bank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "exp"); Playerdata[playerid][Exp] = strval(savingstring);
mysql_fetch_field_row(savingstring, "tut"); Playerdata[playerid][Bank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "xpos"); Playerdata[playerid][Xpos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "ypos"); Playerdata[playerid][Ypos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "zpos"); Playerdata[playerid][Zpos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "apos"); Playerdata[playerid][Apos] = strval(savingstring);
mysql_fetch_field_row(savingstring, "tut"); Playerdata[playerid][Tut] = strval(savingstring);
}
mysql_free_result();
SendClientMessage(playerid, -1, "You have been logged in.");
SetSpawnInfo(playerid, -1, Playerdata[playerid][Skin], Playerdata[playerid][Xpos], Playerdata[playerid][Ypos], Playerdata[playerid][Zpos], Playerdata[playerid][Apos], -1, -1, -1, -1, -1, -1);
SpawnPlayer(playerid);
return 1;
}
Structuur:
Code:
CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(225) NOT NULL, `password` text NOT NULL, `skin` int(5) NOT NULL DEFAULT '101', `Adminlevel` enum('0','1','2','3','4','5','6','7','1337','1338') NOT NULL DEFAULT '0', `ip` varchar(20) NOT NULL, `money` int(225) NOT NULL DEFAULT '5000', `bank` int(225) NOT NULL DEFAULT '2500', `level` int(10) NOT NULL DEFAULT '1', `exp` int(10) NOT NULL DEFAULT '0', `xpos` float NOT NULL DEFAULT '1685.84', `ypos` float NOT NULL DEFAULT '-2333.34', `zpos` float NOT NULL DEFAULT '-2.6797', `apos` float NOT NULL DEFAULT '1.4551', `tut` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;