12.01.2014, 16:12
Код:
forward LoadingScreen(playerid); public LoadingScreen(playerid) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); if(PlayerInfo[playerid][pBanned] > 0) { Connected[playerid] = 0; SendClientMessage(playerid, COLOR_ORANGE, "This account name is banned from the server. Please appeal your ban at http://forums.legion-of-la.com"); Kick(playerid); return 1; } INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); SetPVarInt(playerid, "prelogin", 1); InterpolateCameraPos(playerid, 2356.6528, -1742.2469, 142.7728, 1174.76, -1377.98, 150.88, 50000, CAMERA_MOVE); InterpolateCameraLookAt(playerid, 1513.8353, -1655.7241, 58.0422, 1513.8353, -1655.7241, 58.0422, 50000, CAMERA_MOVE); } else { new ip[126]; GetPlayerIp(playerid, ip, 126); new str[126]; SetPVarInt(playerid, "prelogin", 1); format(str, sizeof(str), ""COL_WHITE"Type your password below to register a new account. Your IP is %s", ip); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_WHITE"Registering...",str,"Register","Quit"); InterpolateCameraPos(playerid, 2356.6528, -1742.2469, 142.7728, 1174.76, -1377.98, 150.88, 50000, CAMERA_MOVE); InterpolateCameraLookAt(playerid, 1513.8353, -1655.7241, 58.0422, 1513.8353, -1655.7241, 58.0422, 50000, CAMERA_MOVE); SetPVarInt(playerid, "Quiz", 1); } new PlayerName2[MAX_PLAYER_NAME], Length; GetPlayerName(playerid, PlayerName2, sizeof(PlayerName2)); Length = strlen(PlayerName2); if(PlayerName2[Length - 1] == '_' || PlayerName2[0] == '_' || strfind(PlayerName2, "_", false) == -1) { SendClientMessage(playerid, COLOR_CYAN, "You have failed to connect with a role play name, please select another name."); ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"Type in another name to play with. \nFirstname_Lastname","Change","No!"); return 1; } return 1; }
Код:
case DIALOG_NAME: { if(!response) { Kick(playerid); } if(response) { SetPlayerName(playerid, inputtext); new Name[MAX_PLAYER_NAME], Len; GetPlayerName(playerid, Name, sizeof(Name)); Len = strlen(Name); if(Name[Len - 1] == '_' || Name[0] == '_' || strfind(Name, "_", false) == -1) { SendClientMessage(playerid, COLOR_CYAN, "You failed to select a role play name, please select another name."); ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"Type in another name to use. \nFirstname_Lastname","Change","No!"); return 1; } INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); } }