#define password1 "gsaforever"
public OnPlayerSpawn(playerid)
{
if (gTeam[playerid] == 0)
{
ShowPlayerDialog( playerid, 104, DIALOG_STYLE_INPUT, "Authentication", "Code number please as Security Agent in trainee, given by Hamza, or any GSA high rank", "Spawn", "Cancel" );
}
}
public bla bla bla
if(dialogid == 104)
{
if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You didn't write anything!");
if (response == 1)
{
if (!strcmp(inputtext, password1)) //checking if it is the players password
{
IsLogged[playerid] = 1;
TogglePlayerControllable(playerid, 1);
}
else //incorrect password
{
ShowPlayerDialog(playerid, 104, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Cancel");
}
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You canceled.");
Kick( playerid );
}
return 1; //returns 1, it has been handled
}
public bla bla bla
if(dialogid == 104)
{
if(!response)
{
SendClientMessage(playerid, COLOR_RED, "You selected exit, therefore you were kicked.");
Kick(playerid);
}
if(!strcmp(inputtext, password1)) //checking if it is the players password
{
IsLogged[playerid] = 1;
TogglePlayerControllable(playerid, 1);
}
else //incorrect password
{
ShowPlayerDialog(playerid, 104, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Cancel");
}
}
return 1; //returns 1, it has been handled
}
Tried it, and no, When I leave the input dialog empty and click on "login" it just log me in.. instead of kicking me out
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == 104)
{
if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "You didn't write anything!");
if (response == 1)
{
if (!strcmp(inputtext, password1)) //checking if it is the players password
{
IsLogged[playerid] = 1;
TogglePlayerControllable(playerid, 1);
}
else //incorrect password
{
ShowPlayerDialog(playerid, 104, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Cancel");
}
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You canceled.");
Kick( playerid );
}
return 1; //returns 1, it has been handled
}
That's what I already got..
pawn Код:
|
if(strlen(inputtext) <= 0)
{