moving gate with pass not working.
#3

pawn Код:
new    Gate,
    bool:IsOpened,
    password[24] = "hellsangels";

Gate = CreateObject(969,1504.50000000,-699.70001221,93.80000305,0.00000000,0.00000000,180.00000000); //object(electricgate) (1)
IsOpened = false; //set it's status to closed

    if(!strcmp("/gate",cmdtext,true))
    {
        if(!IsPlayerInRangeOfPoint(playerid,10.0,1504.50000000,-699.70001221,93.80000305)) return SendClientMessage(playerid,-1, "You aren't near any gate!");//replace with your gate x,y,z
        if(strlen(cmdtext) < 7) return SendClientMessage(playerid,-1,"Usage: /gate [password]");
        if(strcmp(cmdtext[7],password,true)) return SendClientMessage(playerid,-1,"Wrong Password!");
        switch(IsOpened)
        {
            case true:
            {
                IsOpened = false;
                SendClientMessage(playerid,-1,"Gate is closing!");
                MoveObject(Gate,1504.50000000,-699.70001221,93.80000305); //co-ordinates of closed gate
            }
            case false:
            {
                IsOpened = true;
                SendClientMessage(playerid,-1,"Gate is opening!");
                MoveObject(Gate,969,1512.00000000,-699.69897461);//co-ordinates of opened gate
                //here is the error ^
                //right way:
                //MoveObject(Gate, X, Y, Z);
                //and you did:
                //MoveObject(Gate, objectid, X, Y);
            }
        }
        return 1;
    }
}
Reply


Messages In This Thread
moving gate with pass not working. - by reckst4r - 24.11.2011, 14:55
Re: moving gate with pass not working. - by System64 - 24.11.2011, 14:58
Re: moving gate with pass not working. - by Pharrel - 24.11.2011, 14:59
Re: moving gate with pass not working. - by System64 - 24.11.2011, 15:00
Re: moving gate with pass not working. - by Pharrel - 24.11.2011, 15:02
Re: moving gate with pass not working. - by reckst4r - 24.11.2011, 15:06
Re: moving gate with pass not working. - by reckst4r - 24.11.2011, 15:23
Re: moving gate with pass not working. - by Pharrel - 24.11.2011, 15:30
Re: moving gate with pass not working. - by reckst4r - 24.11.2011, 15:34
Re: moving gate with pass not working. - by System64 - 24.11.2011, 16:08

Forum Jump:


Users browsing this thread: 3 Guest(s)