Strange Problem (register dialog) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Strange Problem (register dialog) (
/showthread.php?tid=619346)
Strange Problem (register dialog) -
Razturach - 16.10.2016
I have this code as register dialog:
Код:
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);
}
The problem are following codes:
Код:
//SetSpawnInfo(playerid, 0, Spawn_Skin, Spawn_X, Spawn_Y, Spawn_Z, Spawn_A, 0, 0, 0, 0, 0, 0);
//SpawnPlayer(playerid);
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 ?
Re: Strange Problem (register dialog) -
963852741 - 17.10.2016
Whats in CharacterCreationPhase?
Re: Strange Problem (register dialog) -
Razturach - 17.10.2016
Код:
forward CharacterCreationPhase(playerid);
public CharacterCreationPhase(playerid)
{
for(new i=0;i<sizeof(Register); i++)
{
TextDrawHideForPlayer(playerid, Register[i]);
}
for(new i=0;i<sizeof(CCphase); i++)
{
TextDrawShowForPlayer(playerid, CCphase[i]);
}
return 1;
}