OnDialogResponse
#1

Help! This always kicks the player for "Pressing cancle" when he/she pressed okay

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
if (dialogid == 1)
{
if (response == 1) //making sure "Login" was pressed
{
if (!strcmp(inputtext, PlayerInfo[playerid][pPassword])) //checking if it is the players password
{
OnPlayerLogin(playerid,inputtext);
return 1;
}
else //incorrect password
{
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Cancel"); //shows another dialog, with the same dialogid.
LogAttempts[playerid]++; //increments a variable to know how many time he has tried to login
if (LogAttempts[playerid] >=2) //is it greater then or equal to 2?
{
SendClientMessage(playerid, COLOR_RED, "Too many attempts, kicked");
Kick(playerid);
return 1;
}
}
else //pressed "Cancel"
{
SendClientMessage(playerid, COLOR_RED, "You must Login to play!");
Kick(playerid);
}
}
}
return 1;
}
Reply


Messages In This Thread
OnDialogResponse - by Antonio [G-RP] - 03.05.2010, 03:00
Re: OnDialogResponse - by johnnyc - 03.05.2010, 03:19
Re: OnDialogResponse - by Joe Staff - 03.05.2010, 03:36
Re: OnDialogResponse - by johnnyc - 03.05.2010, 03:39
Re: OnDialogResponse - by CsMu - 27.07.2010, 18:16

Forum Jump:


Users browsing this thread: 2 Guest(s)