11.07.2014, 20:28
So here's my issue, i have
in the class selection so that it can not do the class selection, here's the full code
Now that works fine if the user is registering, but if the user is logging, the user will be disconnected after being spawned,
Now i am trying to figure out why it's doing this.
Код:
TogglePlayerSpectating(playerid, 1);
Код:
public OnPlayerRequestClass(playerid, classid) { TogglePlayerSpectating(playerid, 1); if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit"); } return 1; }
Код:
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_PASSWORD, ""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"); new HashPass[129]; WP_Hash(HashPass, sizeof(HashPass), inputtext); INI_WriteString(File, "Password", HashPass); INI_WriteInt(File,"Cash",1000); INI_WriteInt(File,"Skin",1); INI_WriteInt(File,"AdminLevel",0); INI_WriteInt(File,"Vip",0); INI_Close(File); TogglePlayerSpectating(playerid, 0); SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); } } case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { new HashPass[129]; WP_Hash(HashPass, sizeof(HashPass), inputtext); if(strcmp(HashPass, PlayerInfo[playerid][pPass]) == 0) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); TogglePlayerSpectating(playerid, 0); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok",""); SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] ); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""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; }