How to create a single command which open and close same gate
#4

Quote:
Originally Posted by Keyhead
Посмотреть сообщение
EDIT: Nevermind, I'm a retard. Didn't read it properly. Hold on.

pawn Код:
new gate4;

new gate4open = 0;


public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    gate4 = CreateObject(11327, -134.2530,1125.6167, 21.4020, 0.0000,0.0000,-0.4200);
   
    return 1;
}

CMD:rr(playerid, params[])
{
    if(gate4open == 0)
    {
        MovePlayerObject(playerid, gate4, -134.2530, 1125.6167, 16.9396, 1);
        SendClientMessage(playerid, -1,"RR gate is open");
        gate4open = 1;
    }
    if(gate4open == 1)
    {
        MovePlayerObject(playerid, gate4, -134.2530, 1125.6167, 21,4020, 1);
        SendClientMessage(playerid, -1, "RR gate is closed");
        gate4open = 0;
    }
    return 1;
}
Try this.
It has few thing you forgot to put there, but thanks!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)