02.12.2011, 03:49
Hey.. I used one of the register/login by Y_INI tutorial, and I'm having a problem that after you enter your password you don't spawn, it keeps you on the enterance view, with the left right arrow and the spawn bottom..
Btw.. my public OnSpawnPlayer is set too..
Thanks!
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Level",1);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Helper",0);
INI_WriteInt(File,"Sex",0);
INI_WriteInt(File,"Age",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Tutorial",0);
INI_Close(File);
SpawnPlayer(playerid);
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
SetPlayerPos(playerid,-1968.6703,111.2292,27.6875);
SetPlayerHealth(playerid, 100.0);
SetPlayerInterior(playerid, 0);
if(PlayerInfo[playerid][pTut] == 0)
{
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, 1.808619,32.384357,1199.593750);
SetPlayerInterior(playerid, 1);
TogglePlayerControllable(playerid, 0);
TutStep[playerid] = 1;
SendClientMessage(playerid, COLOR_TUT, "Civilized Gangstaz - Role Play Tutorial");
SendClientMessage(playerid, COLOR_LIGHTRED, "Please read all the tutorial and the rules!");
SendClientMessage(playerid, COLOR_TUT, "What is your gender? (male / female).");
}
}
return 1;
}