Can only use it once.
#1

I used the /ogate to open and then when I got out I done /cgate.
Done it again (/ogate) to see if it was working and it didnt open again :/
Help?:

Commands:
pawn Код:
CMD:ogate(playerid, params[]) {
     if(playerVariables[playerid][pGroup] == 5)
     if(IsPlayerInRangeOfPoint(playerid, 7.0, -411.60000610352, 1361.6999511719, 31.200000762939))
     {
          MoveObject(objectname, -411.60000610352, 1362, 14.800000190735, 1);
     }
     else
     {
          SendClientMessage(playerid, COLOR_RED, "You are either not in range or not apart of the S.A.S!");
     }
     return 1;
}
pawn Код:
CMD:cgate(playerid, params[]) {
     if(playerVariables[playerid][pGroup] == 5)
     if(IsPlayerInRangeOfPoint(playerid, 7.0, -411.60000610352, 1361.6999511719, 31.200000762939))
     {
             MoveObject(objectname2, -411.60000610352, 1361.6999511719, 31.200000762939, 1);
     }
     else
     {
           SendClientMessage(playerid, COLOR_RED, "YOu are either not in range or not apart of the S.A.S!");
     }
     return 1;
}
Reply
#2

This goes near the top of your script...or outside of the gate cmd
pawn Код:
new bool:gateopen = false;
pawn Код:
CMD:gate(playerid, params[])
{
    if(playerVariables[playerid][pGroup] == 5)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -411.60000610352, 1361.6999511719, 31.200000762939))
        {
            if(gateopen == false)
            {
                MoveObject(objectname, -411.60000610352, 1362, 14.800000190735, 1);
            }
            else
            {
                MoveObject(objectname2, -411.60000610352, 1361.6999511719, 31.200000762939, 1);
            }
        }
        else SendClientMessage(playerid, COLOR_RED, "You aren't near the S.A.S. gate!");
    }
    else return SendClientMessage(playerid, COLOR_RED, "You aren't part of S.A.S!");
    return 1;
}
Hmm..try this, if it still doesn't work what are the objectname and objectname2 defines
Reply
#3

objectname2 is the Gate underground so I knew what the coords were.. and objectname was the one that was on top of the land

EDIT: It doesnt close.
Reply
#4

Quote:
Originally Posted by [MP]Ditch
Посмотреть сообщение
objectname2 is the Gate underground so I knew what the coords were.. and objectname was the one that was on top of the land
So you're using two different objects to open and close? Wouldn't you need two more moveobjects then?
Reply
#5

Objectname is the one on top. Which is visible, and objectname2 is just underground so I could get the coords, its still there. Shall I remove it or?
Reply
#6

Well, if there's another object involved in this....and we're moving it when it closes, we'd need to open it too when we open the gate that would create another moveobject lol
Reply
#7

What? lol im confused,, you got Skype or MSN?
Reply
#8

in the cgate, use the same object as in the ogate:
pawn Код:
MoveObject(objectname, -411.60000610352, 1361.6999511719, 31.200000762939, 1);
you dont need 2 objects, only their positions. sems to be set already
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)