[HELP!!] Gates with password
#1

problem is that, what i can open these doors with any password, except which i set "45823"

pawn Код:
#define doorPw "45823"
new bool:DoorStatus;

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK && IsPlayerInRangeOfPoint(playerid, 1.5, 2678.04663086,3966.71850586,7.23182821))
    if(newkeys & KEY_SECONDARY_ATTACK && IsPlayerInRangeOfPoint(playerid, 1.5, 2675.45922852,3964.38964844,7.23459196))
    {
        ShowPlayerDialog(playerid, 1, 1, "Doors", "Please type in the password to continue:", "Go", "Cancel");
    }
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(!strcmp(inputtext, doorPw, false) == false)
        {
            if(!DoorStatus)
            {
                MoveDynamicObject(labdoor, 2674.99414062,3967.00097656,8.58553982, 2.0);
                SetTimer("labdoor", 4500, false);
                SetTimer("CloseDoors", 4500, false);
                DoorStatus = true;
            }
            return 1;
        }
        else return ShowPlayerDialog(playerid, 2, 0, "Error", "That's not the right password!", "Ok", "");
    }
    return 0;
}
forward CloseDoors();
public CloseDoors()
{
    MoveDynamicObject(labdoor, 2674.99438477,3967.00122070,5.57493162, 2.0); // close the doors here
    DoorStatus = false;
    return 1;
}
Reply


Messages In This Thread
[HELP!!] Gates with password - by Darien - 02.02.2011, 11:37
AW: [HELP!!] Gates with password - by !Phoenix! - 02.02.2011, 11:54
Re: AW: [HELP!!] Gates with password - by Darien - 02.02.2011, 12:16
Re: [HELP!!] Gates with password - by Vince - 02.02.2011, 12:27
AW: [HELP!!] Gates with password - by !Phoenix! - 02.02.2011, 12:38
Re: [HELP!!] Gates with password - by Darien - 02.02.2011, 15:11
AW: [HELP!!] Gates with password - by !Phoenix! - 02.02.2011, 15:19
Re: [HELP!!] Gates with password - by Darien - 02.02.2011, 15:28
Re: [HELP!!] Gates with password - by Darien - 02.02.2011, 15:31
AW: [HELP!!] Gates with password - by !Phoenix! - 02.02.2011, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)