02.01.2013, 21:42
Hello everyone, I was converting the system login and register the HC-RP in dialog, but does not work. The compiler warning it works without error, but then in game does not work, insert the password and the dialog closes. Here is the code of commands and dialog response ..
Please!
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
for(new i = 0;i<USED_DRAWS;i++)
{
if(TextDrawInfo[i][used] == 1){TextDrawShowForPlayer(playerid,TextDrawInfo[i][id]);}
}
ClearChatbox(playerid, 1000);
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw5);
TextDrawShowForPlayer(playerid, Textdraw6);
TextDrawShowForPlayer(playerid, Textdraw7);
SpawnPlayer(playerid);
SpawnPlayer(playerid);
SetPlayerPos(playerid, -1484.000732, 467.090728, 45.984489);
SetPlayerVirtualWorld(playerid, 10);
if (gPlayerAccount[playerid] == 1)
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_PASSWORD, "{2ADEDB}PluriRP Project Login", "{FFFFFF}Bentornato!\nInserisci la tua password\nper loggare!","Login","Esci");
}
else
{
ShowPlayerDialog(playerid, 124, DIALOG_STYLE_PASSWORD, "{2ADEDB}PluriRP Project Register", "{FFFFFF}Benvenuto!\nInserisci la tua nuova password\nper registrarti!","Registrati","Esci");
}
SetPlayerCameraPos(playerid, -1484.000732, 467.090728, 45.984489);
SetPlayerCameraLookAt(playerid, -1575.775390, 619.471069, 45.556785);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
}
else SpawnPlayer(playerid);
return false;
}
Dialog response
if(dialogid == 123 && response) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
{
if (response == 1)
{
if(strlen(inputtext))
{
OnPlayerLogin(playerid,inputtext);
}
else if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_PASSWORD, "{2ADEDB}PluriRP Project Login", "{FFFFFF}Bentornato!\nInserisci la tua password\nper loggare!","Login","Esci");
}
}
else return Kick(playerid);
}
if(dialogid == 124 && response) // If the dialogid is 1 (our dialog) and they pressed 'Purchase'
{
if (response == 1)
{
if(strlen(inputtext))
{
OnPlayerRegister(playerid,inputtext);
}
else if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, 124, DIALOG_STYLE_PASSWORD, "{2ADEDB}PluriRP Project Register", "{FFFFFF}Benvenuto!\nInserisci la tua nuova password\nper registrarti!","Registrati","Esci");
if(strfind(inputtext, "=") != -1)
{
ShowPlayerDialog(playerid, 124, DIALOG_STYLE_PASSWORD, "{2ADEDB}PluriRP Project Register", "{FFFFFF}Benvenuto!\nInserisci la tua nuova password\nper registrarti!","Registrati","Esci");
SendClientMessage(playerid, COLOR_RED, "Carattere non ammesso");
return 1;
}
if(strfind(inputtext, ",") != -1)
{
ShowPlayerDialog(playerid, 124, DIALOG_STYLE_PASSWORD, "{2ADEDB}PluriRP Project Register", "{FFFFFF}Benvenuto!\nInserisci la tua nuova password\nper registrarti!","Registrati","Esci");
SendClientMessage(playerid, COLOR_RED, "Carattere non ammesso");
return 1;
}
}
}
else return Kick(playerid);
}