How to make smth like that
#1

I dont know how to make stuff like open doors with password.

Eample : i Want to open the doors i press [F] button near doors and in dialog box i should type password, and doors will open. After 5s doors will close.
Reply
#2

These are some of the functions and callbacks to start with: OnPlayerKeyStateChange, ShowPlayerDialog, OnDialogResponse, SetTimerEx MoveObject.
Reply
#3

i dont understand anything, i need script example
Reply
#4

i have this one

Код:
if IsPlayerInRangeOfPoint(playerid, 1.5,2680.30444336,3969.71020508,7.33100510))
	{
	    MoveObject(boxes, 2683.57153320,3966.04736328,7.33100510, 2.2500000);
	    SetTimer("boxes", 4500, false);
	}

and some errors

C:\Documents and Settings\Minde\Desktop\Server 3c\pawno\include\streamer.inc(435) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Minde\Desktop\Server 3c\pawno\include\streamer.inc(449) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Minde\Desktop\SERVER~1\FILTER~1\miestas.pwn(20) : warning 217: loose indentation
C:\DOCUME~1\Minde\Desktop\SERVER~1\FILTER~1\miestas.pwn(596) : warning 217: loose indentation
C:\DOCUME~1\Minde\Desktop\SERVER~1\FILTER~1\miestas.pwn(24) : warning 204: symbol is assigned a value that is never used: "boxes"
C:\DOCUME~1\Minde\Desktop\SERVER~1\FILTER~1\miestas.pwn(24 -- 598) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

Moveobject needs a speed parameter to
Reply
#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
#7

mmmm
Reply
#8

it compiled without errors but gates wont to move
Reply
#9

Did you remember to change the co-ordinates for the moved object?
pawn Код:
MoveObject(boxes, 2683.57153320,3966.04736328,7.33100510, 2.2500000, 2.0); // This is the default you gave us, should probably be changed.
Reply
#10

Quote:
Originally Posted by Not available
Посмотреть сообщение
Did you remember to change the co-ordinates for the moved object?
pawn Код:
MoveObject(boxes, 2683.57153320,3966.04736328,7.33100510, 2.2500000, 2.0); // This is the default you gave us, should probably be changed.
Yes, and i deleted one space between
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{


then gates will open, but not close
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)