Double command.
#2

Make a global variable that stores if the gates is open or closed. Then you can check it after strcmp and open/close it

pawn Код:
new gateopen = 0;

...
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/gate", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10, 1588.9812011719, -1638.0415039063, 14.952730178833))
        {                  
            if(!gateopen) {
                MoveObject(obj, 1588.9812011719, -1638.0415039063, 7.952730178833, 2.00);
                gateopen = 1;
            } else {
                MoveObject(obj, 1588.9812011719, -1638.0415039063, 14.952730178833, 2.00);
                gateopen = 0;
            }                
        }
    return 1;
    }
       
}
I dont know which move opens the gate and which closes it, just swap them if it is wrong.

EDIT: I just noticed, that you do not need the IsPlayerConnected. If a player is not on the server, he cant type a command
Reply


Messages In This Thread
Double command. - by Scriptissue - 27.09.2010, 13:17
Re: Double command. - by Mauzen - 27.09.2010, 13:23
Re: Double command. - by Scriptissue - 27.09.2010, 13:54
Re: Double command. - by Cameltoe - 27.09.2010, 13:57
Re: Double command. - by Scriptissue - 27.09.2010, 13:58
Re: Double command. - by Cameltoe - 27.09.2010, 14:03
Re: Double command. - by Scriptissue - 27.09.2010, 14:04
Re: Double command. - by Cameltoe - 27.09.2010, 14:28
Re: Double command. - by Scriptissue - 27.09.2010, 14:28
Re: Double command. - by Cameltoe - 27.09.2010, 14:30

Forum Jump:


Users browsing this thread: 2 Guest(s)