[HELP] Move gates
#9

mayb u know how to fix tht because it fails.
1.when im want to open this door i no need to put password ijust press cancel, ok or enter and doors open without password.

2. If i want open door next time doors wont to open.

pawn Код:
//--------- Research gates with password ---

#define doorPw "MyCatIsDumb"
new bool:DoorStatus;

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK && IsPlayerInRangeOfPoint(playerid, 1.5, 2678.04663086,3966.71850586,7.23182821))
    {
        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))
        {
            if(!DoorStatus)
            {
                MoveDynamicObject(labdoor, 2674.99414062,3967.00097656,8.58553982, 2.0);
                SetTimer("labdoor", 4500, false);
                SetTimer("CloseDoors", 4500, false);
                DoorStatus = 1;
            }
            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
    return 1;
}
Reply


Messages In This Thread
[HELP] Move gates [SOLVED] - by Darien - 26.01.2011, 15:10
Re: [HELP] Move gates - by Steven Paul - 26.01.2011, 15:25
Re: [HELP] Move gates - by Darien - 26.01.2011, 15:26
Re: [HELP] Move gates - by Darien - 26.01.2011, 16:33
Re: [HELP] Move gates - by ricardo178 - 26.01.2011, 16:45
Re: [HELP] Move gates - by Darien - 26.01.2011, 16:51
Re: [HELP] Move gates - by ricardo178 - 26.01.2011, 19:01
Re: [HELP] Move gates - by Darien - 27.01.2011, 10:10
Re: [HELP] Move gates - by Darien - 27.01.2011, 10:13
Re: [HELP] Move gates - by ricardo178 - 27.01.2011, 12:26

Forum Jump:


Users browsing this thread: 2 Guest(s)