Help Keys ! :)
#1

How to set on KEY_YES to open and close doors ? That is my script.This script dont working help me with open and close in KEY_YES Thanks


pawn Код:
if(newkeys == KEY_YES)
    {
    MoveObject(pd, 244.80000305,72.40000153,1004.00000000,2);
    MoveObject(pd1, 248.00000000,72.40000153,1004.00000000,2);
    }
    if(newkeys == KEY_YES)
    {
    MoveObject(pd, 245.80000305,72.40000153,1004.00000000,2);
    MoveObject(pd1, 247.00000000,72.40000153,1004.00000000,2);
    }
Reply
#2

WTF are you trying to do man! Why you have this 2x
Код:
if(newkeys == KEY_YES)
Reply
#3

I Want to open and close the doors with this key KEY_YES how to create this.Want for this.I Press Y and open door and i press again Y and close door please Help ! WHO HELP ME I GIVE REP ++
Reply
#4

Use "else" statements maybe
Reply
#5

Dont Working
Reply
#6

Dude when the door is opened you must save it in a variable then use that variable to check if the door is opened or not. Then close it.
Reply
#7

pawn Код:
new DoorOpened[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    DoorOpened[playerid] = 0;
    return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_YES)
    {
        if(DoorOpened = 0)
        {
            MoveObject(pd, 244.80000305,72.40000153,1004.00000000,2);
            MoveObject(pd1, 248.00000000,72.40000153,1004.00000000,2);
            DoorOpened = 1;
        }
        else
        {
            MoveObject(pd, 245.80000305,72.40000153,1004.00000000,2);
            MoveObject(pd1, 247.00000000,72.40000153,1004.00000000,2);
            DoorOpened = 0;
        }
    return 1;
}
Reply
#8

Dont working that script Tab it Y and slow it and again you untab and close
Reply
#9

Quote:
Originally Posted by teomakedonija
Посмотреть сообщение
Dont working that script Tab it Y and slow it and again you untab and close
I don't get what are you trying to say.
Reply
#10

BUMP !! GIVE REP ++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)