27.09.2010, 13:23
Make a global variable that stores if the gates is open or closed. Then you can check it after strcmp and open/close it
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
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;
}
}
EDIT: I just noticed, that you do not need the IsPlayerConnected. If a player is not on the server, he cant type a command