12.12.2011, 16:31
How do I make this gate close by using the same command? For example, I walk up to the gate, I type /gate and it will open, when I use the /gate command again it should close.
Here is the code for the closed gate:
pawn Код:
if(strcmp(cmd, "/gate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are not logged in yet.");
return 1;
}
MoveObject(pdgate, 2338.68, 2450.26, 8.33, 2.00);
PlayerPlaySound(playerid, 1153, 0.0, 0.0, 0.0);
return 1;
}
return 1;
}
pawn Код:
pdgate = CreateObject(971, 2335.14, 2444.29, 8.33, 0.00, 0.00, 60.44);