How to make smth like that
#6

Okei, I made a quick draft that you could work with. This is not tested and may return errors as I wrote it on a Mac without a compiler =/

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

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK && IsPlayerInRangeOfPoint(playerid, 1.5, 2680.30444336, 3969.71020508, 7.33100510))
    {
        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)
            {
                MoveObject(boxes, 2683.57153320,3966.04736328,7.33100510, 2.2500000, 2.0);
                SetTimer("boxes", 4500, false);
            }
            return 1;
        }
        else return ShowPlayerDialog(playerid, 2, 0, "Error", "That's not the right password!", "Ok", "");
    }
    return 0;
}

forward CloseDoors();
public CloseDoors()
{
    if(DoorStatus)
    {
        MoveObject(boxes, 2683.57153320,3966.04736328,7.33100510, 2.2500000, 2.0); // close the doors here
    }
    return 1;
}
Reply


Messages In This Thread
How to make smth like that - by Darien - 17.01.2011, 17:43
Re: How to make smth like that - by Alex_Valde - 17.01.2011, 17:48
Re: How to make smth like that - by Darien - 17.01.2011, 18:44
Re: How to make smth like that - by Darien - 17.01.2011, 18:46
Re: How to make smth like that - by alpha500delta - 17.01.2011, 18:49
Re: How to make smth like that - by Not available - 17.01.2011, 18:57
Re: How to make smth like that - by Darien - 18.01.2011, 15:48
Re: How to make smth like that - by Darien - 22.01.2011, 16:46
Re: How to make smth like that - by Not available - 22.01.2011, 22:33
Re: How to make smth like that - by Darien - 23.01.2011, 12:12

Forum Jump:


Users browsing this thread: 3 Guest(s)