14.11.2012, 13:09
Hi!
I've got a problem with my OnPlayerLogin.
I replaced the mysql_get_row with mysqlfetchacctsingle, because the mysql_get_row didn't work on my host and now, when I log in, it just kicks me out, saying "Server closed the connection."
Here's the pawn code:
I've got a problem with my OnPlayerLogin.
I replaced the mysql_get_row with mysqlfetchacctsingle, because the mysql_get_row didn't work on my host and now, when I log in, it just kicks me out, saying "Server closed the connection."
Here's the pawn code:
pawn Code:
public OnPlayerLogin(playerid,password[]) // by Luk0r v1.0
{
MySQLCheckConnection();
printf("Check 1");
new tmp2[256];
new string2[64];
new str[128];
new
string[256]
;
new playername2[MAX_PLAYER_NAME];
new playernamesplit[3][MAX_PLAYER_NAME];
GetRPName(playerid, playername2, sizeof(playername2));
split(playername2, playernamesplit, '_');
MySQLFetchAcctSingle(KasutajaInfo[playerid][pSQLID], "Password", KasutajaInfo[playerid][pKey]);
printf("Check 2");
if(!strcmp(KasutajaInfo[playerid][pKey],password, true ) )
{
new Query[1024];
new Field[64];
new result[256];
printf("Check 3");
format(Query, sizeof(Query), "SELECT * FROM `players` WHERE `id` = '%d'", KasutajaInfo[playerid][pSQLID] );
mysql_query(Query);
mysql_store_result();
printf("Check 4");
if(mysql_fetch_row_format(Query,"|"))
{
printf("Check 5");
MySQLFetchAcctSingle(KasutajaInfo[playerid][pSQLID], "PlayerLevel", KasutajaInfo[playerid][pLevel]);
// A couple of more lines, about a hundred. :D