16.10.2016, 18:32
I have this code as register dialog:
The problem are following codes:
So if I comment those two lines whenever I register server just close the connection, if codes are there, things are working fine, why's that ?
Код:
case DIALOG_REGISTER: { if(strlen(inputtext) < 6) { SendClientMessage(playerid, -1, "You're account password must consist of atleast 6 characters."); return 1; } WP_Hash(AccountData[playerid][Password], 129, inputtext); format(szQuery, sizeof(szQuery), "INSERT INTO `accounts` (username, password, ip) VALUES ('%s', '%s', '%s')", GetPlayerNameEx(playerid), AccountData[playerid][Password], AccountData[playerid][Ip]); mysql_function_query(sqlconnection, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid); TogglePlayerSpectating(playerid, 1); SendClientMessage(playerid, -1, "Welcome, you have now registered."); CharacterCreationPhase(playerid); //SetSpawnInfo(playerid, 0, Spawn_Skin, Spawn_X, Spawn_Y, Spawn_Z, Spawn_A, 0, 0, 0, 0, 0, 0); //SpawnPlayer(playerid); }
Код:
//SetSpawnInfo(playerid, 0, Spawn_Skin, Spawn_X, Spawn_Y, Spawn_Z, Spawn_A, 0, 0, 0, 0, 0, 0); //SpawnPlayer(playerid);