30.10.2012, 16:26
Ok.Change your code to
Then in your OnDialogResponse
pawn Код:
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Rules", "Don't use any hack\nPlease dont spam in the chat\n Are you agree with the rules", "Yes", "No");
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 5)
{
if(response) {
new string[MAX_PLAYER_NAME];
ResetStats(playerid);
//police
BigEar[playerid] = 0;
OnDuty[playerid] = 0;
JailPrice[playerid] = 0;
HelpEnabled[playerid] = true;
//=======================
Enabled[playerid]=0;
Pers[playerid]=0;
//MAP ICONS
SetPlayerMapIcon(playerid, 0, 2495.6240,-1669.8031,13.3359, 19, -1);
if(!dini_Exists(string))
{
gPlayerAccount[playerid] = 0;
new regstring[256];
new regname[64];
SendClientMessage(playerid, COLOR_YELLOW, "Ти нямаш акаунт. Моля, регистрирай твоя акаунт.");
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"{FFFFFF}[ B-U-L-G-A-R-I-A-N ]{80FF00}[ S-E-R-V-E-R]{FF0000}[0.3]\n{80FF00}Моля регистрирай твоя акаунт преди да се логнеш");
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD,"Регистрация:",regstring,"Регистрирай","Излез");
return 1;
}
else
{
gPlayerAccount[playerid] = 1;
new loginstring[256];
new loginname[64];
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Това име е регистрирано.");
SendClientMessage(playerid, COLOR_WHITE, "HINT: Ти може да се логнеш като си въведеш паролата");
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"{FFFFFF}server{80FF00}server{FF0000}[0.3]\n{80FF00}Името е регистрирано. Моля, въведи твоята парола");
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD,"Влизане:",loginstring,"Влез","Излез");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You MUST agree to the server rules to play here.");
Kick(playerid);
}
}
return 1;
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}