tryp
Умник
Хотел продать эту сис-му но никто не купил, в честь Нового Года я подумал и решил, что выложу никому не нужную сис-му
Начнем...
[hr][/hr]
public OnPlayerConnect(playerid)
Теперь ищем какой паблик у вас отвечает когда игрок заходит на сервер и у него выскакивает диалоговое окно авторизации
Либо public OnPlayerConnect(playerid) или public OnPlayerRequestClass(playerid, classid)
Находим
Заменяем на
Создадим public OnPlayerClickPlayerTextDraw(playerid, PlayerText
layertextid) (куда угодно)
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
Все что хотите меняйте под себя
P.S Сис-ма авторизации показана на примере MXini
Начнем...
[hr][/hr]
PHP:
new PlayerText:login[16][MAX_PLAYERS];
PHP:
login[0][playerid] = CreatePlayerTextDraw(playerid,483.000000, 90.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[0][playerid], 255);
PlayerTextDrawFont(playerid,login[0][playerid], 0);
PlayerTextDrawLetterSize(playerid,login[0][playerid], 0.500000, 27.000000);
PlayerTextDrawColor(playerid,login[0][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[0][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[0][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[0][playerid], 1);
PlayerTextDrawUseBox(playerid,login[0][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[0][playerid], 572661648);
PlayerTextDrawTextSize(playerid,login[0][playerid], 168.000000, 11.000000);
PlayerTextDrawSetSelectable(playerid,login[0][playerid], 0);
login[1][playerid] = CreatePlayerTextDraw(playerid,241.000000, 114.000000, "Russian World RP");
PlayerTextDrawBackgroundColor(playerid,login[1][playerid], -16776961);
PlayerTextDrawFont(playerid,login[1][playerid], 0);
PlayerTextDrawLetterSize(playerid,login[1][playerid], 0.709999, 2.899998);
PlayerTextDrawColor(playerid,login[1][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[1][playerid], 1);
PlayerTextDrawSetProportional(playerid,login[1][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[1][playerid], 0);
login[2][playerid] = CreatePlayerTextDraw(playerid,481.000000, 162.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[2][playerid], -16776961);
PlayerTextDrawFont(playerid,login[2][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[2][playerid], 0.400000, 18.500000);
PlayerTextDrawColor(playerid,login[2][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[2][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[2][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[2][playerid], 1);
PlayerTextDrawUseBox(playerid,login[2][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[2][playerid], -1);
PlayerTextDrawTextSize(playerid,login[2][playerid], 171.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid,login[2][playerid], 0);
login[3][playerid] = CreatePlayerTextDraw(playerid,325.000000, 162.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[3][playerid], 255);
PlayerTextDrawFont(playerid,login[3][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[3][playerid], 0.500000, 18.499998);
PlayerTextDrawColor(playerid,login[3][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[3][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[3][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[3][playerid], 1);
PlayerTextDrawUseBox(playerid,login[3][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[3][playerid], 255);
PlayerTextDrawTextSize(playerid,login[3][playerid], 321.000000, 0.000000);
PlayerTextDrawSetSelectable(playerid,login[3][playerid], 0);
login[4][playerid] = CreatePlayerTextDraw(playerid,199.000000, 161.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[4][playerid], 255);
PlayerTextDrawFont(playerid,login[4][playerid], 5);
PlayerTextDrawLetterSize(playerid,login[4][playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,login[4][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[4][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[4][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[4][playerid], 1);
PlayerTextDrawUseBox(playerid,login[4][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[4][playerid], 255);
PlayerTextDrawTextSize(playerid,login[4][playerid], 104.000000, 151.000000);
PlayerTextDrawSetPreviewModel(playerid, login[4][playerid], 0);
PlayerTextDrawSetPreviewRot(playerid, login[4][playerid], 0.000000, 0.000000, 360.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,login[4][playerid], 0);
login[5][playerid] = CreatePlayerTextDraw(playerid,249.000000, 313.000000, "_");//5текстдрайв имя
PlayerTextDrawAlignment(playerid,login[5][playerid], 2);
PlayerTextDrawBackgroundColor(playerid,login[5][playerid], 65535);
PlayerTextDrawFont(playerid,login[5][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[5][playerid], 0.460000, 1.000000);
PlayerTextDrawColor(playerid,login[5][playerid], 16711935);
PlayerTextDrawSetOutline(playerid,login[5][playerid], 1);
PlayerTextDrawSetProportional(playerid,login[5][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[5][playerid], 0);
login[6][playerid] = CreatePlayerTextDraw(playerid,373.000000, 171.000000, "Login");
PlayerTextDrawBackgroundColor(playerid,login[6][playerid], 16711935);
PlayerTextDrawFont(playerid,login[6][playerid], 0);
PlayerTextDrawLetterSize(playerid,login[6][playerid], 0.939999, 1.700000);
PlayerTextDrawColor(playerid,login[6][playerid], 255);
PlayerTextDrawSetOutline(playerid,login[6][playerid], 1);
PlayerTextDrawSetProportional(playerid,login[6][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[6][playerid], 0);
login[7][playerid] = CreatePlayerTextDraw(playerid,330.000000, 210.000000, "E-mail");
PlayerTextDrawBackgroundColor(playerid,login[7][playerid], 255);
PlayerTextDrawFont(playerid,login[7][playerid], 3);
PlayerTextDrawLetterSize(playerid,login[7][playerid], 0.409999, 0.799998);
PlayerTextDrawColor(playerid,login[7][playerid], 16711935);
PlayerTextDrawSetOutline(playerid,login[7][playerid], 1);
PlayerTextDrawSetProportional(playerid,login[7][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[7][playerid], 0);
login[8][playerid] = CreatePlayerTextDraw(playerid,328.000000, 239.000000, "Password");
PlayerTextDrawBackgroundColor(playerid,login[8][playerid], 255);
PlayerTextDrawFont(playerid,login[8][playerid], 3);
PlayerTextDrawLetterSize(playerid,login[8][playerid], 0.300000, 1.100000);
PlayerTextDrawColor(playerid,login[8][playerid], -16776961);
PlayerTextDrawSetOutline(playerid,login[8][playerid], 1);
PlayerTextDrawSetProportional(playerid,login[8][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[8][playerid], 0);
login[9][playerid] = CreatePlayerTextDraw(playerid,479.000000, 209.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[9][playerid], 255);
PlayerTextDrawFont(playerid,login[9][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[9][playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,login[9][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[9][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[9][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[9][playerid], 1);
PlayerTextDrawUseBox(playerid,login[9][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[9][playerid], 572661657);
PlayerTextDrawTextSize(playerid,login[9][playerid], 380.000000, -2.000000);
PlayerTextDrawSetSelectable(playerid,login[9][playerid], 0);
login[10][playerid] = CreatePlayerTextDraw(playerid,479.000000, 239.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[10][playerid], 255);
PlayerTextDrawFont(playerid,login[10][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[10][playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,login[10][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[10][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[10][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[10][playerid], 1);
PlayerTextDrawUseBox(playerid,login[10][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[10][playerid], 572661657);
PlayerTextDrawTextSize(playerid,login[10][playerid], 380.000000, -2.000000);
PlayerTextDrawSetSelectable(playerid,login[10][playerid], 0);
login[11][playerid] = CreatePlayerTextDraw(playerid,390.000000, 288.000000, "LD_CHAT:thumbup");
PlayerTextDrawBackgroundColor(playerid,login[11][playerid], 255);
PlayerTextDrawFont(playerid,login[11][playerid], 4);
PlayerTextDrawLetterSize(playerid,login[11][playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,login[11][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[11][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[11][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[11][playerid], 1);
PlayerTextDrawUseBox(playerid,login[11][playerid], 1);
PlayerTextDrawBoxColor(playerid,login[11][playerid], 255);
PlayerTextDrawTextSize(playerid,login[11][playerid], 21.000000, 21.000000);
PlayerTextDrawSetSelectable(playerid,login[11][playerid], 1);
login[12][playerid] = CreatePlayerTextDraw(playerid,430.000000, 208.000000, "Enter mail");//12 маил
PlayerTextDrawTextSize(playerid,login[12][playerid],10.0 , 9.6);
PlayerTextDrawAlignment(playerid,login[12][playerid], 2);
PlayerTextDrawBackgroundColor(playerid,login[12][playerid], 255);
PlayerTextDrawFont(playerid,login[12][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[12][playerid], 0.370000, 1.000000);
PlayerTextDrawColor(playerid,login[12][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[12][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[12][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[12][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[12][playerid], 1);
login[13][playerid] = CreatePlayerTextDraw(playerid,429.000000, 238.000000, "Enter password");//Пароль
PlayerTextDrawTextSize(playerid,login[13][playerid],10.0 , 9.6);
PlayerTextDrawAlignment(playerid,login[13][playerid], 2);
PlayerTextDrawBackgroundColor(playerid,login[13][playerid], 255);
PlayerTextDrawFont(playerid,login[13][playerid], 1);
PlayerTextDrawLetterSize(playerid,login[13][playerid], 0.360000, 1.000000);
PlayerTextDrawColor(playerid,login[13][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[13][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[13][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[13][playerid], 1);
PlayerTextDrawSetSelectable(playerid,login[13][playerid], 1);
login[14][playerid] = CreatePlayerTextDraw(playerid,170.000000, 86.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[14][playerid], 0);
PlayerTextDrawFont(playerid,login[14][playerid], 5);
PlayerTextDrawLetterSize(playerid,login[14][playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,login[14][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[14][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[14][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[14][playerid], 1);
PlayerTextDrawTextSize(playerid,login[14][playerid], 71.000000, 77.000000);
PlayerTextDrawSetPreviewModel(playerid, login[14][playerid], 19076);
PlayerTextDrawSetPreviewRot(playerid, login[14][playerid], -16.000000, 0.000000, -55.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,login[14][playerid], 0);
login[15][playerid] = CreatePlayerTextDraw(playerid,411.000000, 86.000000, "_");
PlayerTextDrawBackgroundColor(playerid,login[15][playerid], 0);
PlayerTextDrawFont(playerid,login[15][playerid], 5);
PlayerTextDrawLetterSize(playerid,login[15][playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,login[15][playerid], -1);
PlayerTextDrawSetOutline(playerid,login[15][playerid], 0);
PlayerTextDrawSetProportional(playerid,login[15][playerid], 1);
PlayerTextDrawSetShadow(playerid,login[15][playerid], 1);
PlayerTextDrawTextSize(playerid,login[15][playerid], 71.000000, 77.000000);
PlayerTextDrawSetPreviewModel(playerid, login[15][playerid], 19076);
PlayerTextDrawSetPreviewRot(playerid, login[15][playerid], -16.000000, 0.000000, -55.000000, 1.000000);
PlayerTextDrawSetSelectable(playerid,login[15][playerid], 0);
Либо public OnPlayerConnect(playerid) или public OnPlayerRequestClass(playerid, classid)
Находим
PHP:
if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
new bac[512],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(playerid, playername, sizeof(playername));
format(bac, sizeof(bac), "3/%s.ini", playername);
if(gPlayerAccount[playerid] != 0)
{
//gPlayerAccount[playerid] = 1;
format(bac, sizeof(bac),"\n*\t{FFFFFF}Добро пожаловать на сервер {FF4500}•[RussianWorld]•[RUS/UA]•{FFFFFF}\n*\tЭтот аккаунт зарегестрирован\n*\tМы рады видеть вас на сервере,\n*\tНаш сервер один из лучших!\n*\tВаш логин: {FF4500}%s{FFFFFF}\n*\tВведите ваш пароль для входа:",name);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{FFFFFF}Авторизация",bac,"Готово","");
return true;
}
else
{
format(bac, sizeof(bac),"{FFFFFF}\n*\tДобро пожаловать на сервер {FF4500}•[RussianWorld]•[RUS/UA]•{FFFFFF}\n*\tРегистрация нового персонажа\n*\tМы рады видеть вас на сервере,\n*\tНаш сервер один из лучших!\n*\tВаш логин: {FF4500}%s{FFFFFF}\n*\tВведите пароль для регистрации:", name);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Регистрация",bac,"Далее","");
InterpolateCameraPos(playerid, 981.568847, -1876.624023, 38.559371, 156.572570, -1767.532836, 20.262689, 30000);
InterpolateCameraLookAt(playerid, 978.025146, -1879.961303, 37.417201, 160.096572, -1771.007568, 19.550277, 30000);
return true;
}
}
PHP:
if(RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
new bac[512],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(playerid, playername, sizeof(playername));
format(bac, sizeof(bac), "3/%s.ini", playername);
if(gPlayerAccount[playerid] != 0)
{
//gPlayerAccount[playerid] = 1;
for(new i=0; i<16; i++)PlayerTextDrawShow(playerid, login[i][playerid]);
SelectTextDraw(playerid, COLOR_YELLOW);
PlayerTextDrawSetString(playerid, login[5][playerid], playername);
return true;
}
else
{
format(bac, sizeof(bac),"{FFFFFF}\n*\tДобро пожаловать на сервер {FF4500}•[RussianWorld]•[RUS/UA]•{FFFFFF}\n*\tРегистрация нового персонажа\n*\tМы рады видеть вас на сервере,\n*\tНаш сервер один из лучших!\n*\tВаш логин: {FF4500}%s{FFFFFF}\n*\tВведите пароль для регистрации:", name);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Регистрация",bac,"Далее","");
InterpolateCameraPos(playerid, 981.568847, -1876.624023, 38.559371, 156.572570, -1767.532836, 20.262689, 30000);
InterpolateCameraLookAt(playerid, 978.025146, -1879.961303, 37.417201, 160.096572, -1771.007568, 19.550277, 30000);
return true;
}
}
PHP:
new string1[333],string[128],playername[MAX_PLAYER_NAME];
if(playertextid == login[12][playerid])
{
format(string1,sizeof(string1),"{ffffff}Введите свой e-mail\n\n {ffffff}Если вы забыли свой e-mail, напишите слово {ffcc00}'Забыл'{ffffff} так же с заглавной буквы\n и востановите свое мыло");
ShowPlayerDialog(playerid,1912,DIALOG_STYLE_INPUT,"E-mail",string1,"Ок","Отмена");
return true;
}
if(playertextid == login[13][playerid])
{
format(string,sizeof(string),"{ffffff}Введите свой пароль");
ShowPlayerDialog(playerid,1915,DIALOG_STYLE_INPUT,"Password",string,"Ок","Отмена");
return true;
}
if(playertextid == login[11][playerid])
{
new lol[128],lol1[128],pass[256],pass1[256];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"3/%s.ini",playername);//Папка где хранятся акки, у меня папка под названием 3
new File = ini_openFile(string);
ini_getString(File,"Key",pass),strmid(PlayerInfo[playerid][pKey], pass, 0, strlen(pass), 128);
ini_getString(File,"Email",pass1);
ini_closeFile(File);
GetPVarString(playerid,"Mail",lol,sizeof(lol));
GetPVarString(playerid,"Pass",lol1,sizeof(lol1));
if(GetPVarInt(playerid,"Pass1")==0)return GameTextForPlayer(playerid, "~r~Password no enter", 3000, 1);
if(GetPVarInt(playerid,"Mail1")==0)return GameTextForPlayer(playerid, "~r~Mail no enter", 3000, 1);
if(strcmp(PlayerInfo[playerid][pKey],lol1,true) == 0)
{
if(strcmp(pass1,lol,true) == 0)
{
OnPlayerLogin(playerid,lol1);
for(new i=0; i<16; i++)PlayerTextDrawHide(playerid, login[i][playerid]);
CancelSelectTextDraw(playerid);
return 1;
}
else GameTextForPlayer(playerid, "~r~Wrong mail", 3000, 1);
}
else GameTextForPlayer(playerid, "~r~Wrong pass",3000, 1);
}
PHP:
case 1912:
{
if(response)
{
if(!strcmp(inputtext, "Забыл",true))return ShowPlayerDialog(playerid,1913,DIALOG_STYLE_INPUT,"E-mail","Введите свой пароль чтоб восстановить MAIL","Ок","Отмена");
PlayerTextDrawSetString(playerid, login[12][playerid], inputtext);
SetPVarString(playerid,"Mail",inputtext);
SetPVarInt(playerid,"Mail1",1);
}
}
case 1913:
{
if(response)
{
new pass[256];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"3/%s.ini",playername);
new File = ini_openFile(string);
ini_getString(File,"Key",pass);
ini_closeFile(File);
if(!strcmp((inputtext),pass,true))
{
ShowPlayerDialog(playerid,1914,DIALOG_STYLE_INPUT,"E-mail","Введите свой новый E-mail","Ок","Отмена");
}
else ShowPlayerDialog(playerid,1913,DIALOG_STYLE_INPUT,"E-mail","Пароль не верен\n\nВведите свой пароль","Ок","Отмена");
}
else ShowPlayerDialog(playerid,1913,DIALOG_STYLE_INPUT,"E-mail","Пароль не верен\n\nВведите свой пароль","Ок","Отмена");
}
case 1914:
{
if(response)
{
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"3/%s.ini",playername);
new File = ini_openFile(string);
ini_setString(File,"Email",inputtext);
ini_closeFile(File);
PlayerTextDrawSetString(playerid, login[12][playerid], inputtext);
SetPVarString(playerid,"Mail",inputtext);
SetPVarInt(playerid,"Mail1",1);
}
else ShowPlayerDialog(playerid,1914,DIALOG_STYLE_INPUT,"E-mail","Введите свой новый E-mail","Ок","Отмена");
}
case 1915:
{
if(response)
{
PlayerTextDrawSetString(playerid, login[13][playerid], inputtext);
SetPVarString(playerid,"Pass",inputtext);
SetPVarInt(playerid,"Pass1",1);
}
}
P.S Сис-ма авторизации показана на примере MXini
Последнее редактирование:
