05.05.2011, 10:18
pawn Код:
new door1;
new door2;
new bool:door1opened;
new bool:door2opened;
OnGameModeInit()
{
door = CreateObject,---,-2091.6669921875, -844.0361328125, -29.267526626587);
return 1;
}
if (strcmp("/door1", cmdtext, true, 10) == 0)
{
if (IsPlayerInRangeOfPoint(playerid,4,-2093.3371582031, -843.95068359375, -29.267526626587) && door1opened == false)
{
MoveObject(Gate1,-2091.6669921875, -844.0361328125, -29.267526626587, 1);
SendClientMessage(playerid,COLOR_GREY,"ID Accepted: Door1 Opening");
door1opened = true;
return 1;
}
else
{
MoveObject(Gate1,-2093.3371582031, -843.95068359375, -29.267526626587, 1);
SendClientMessage(playerid,COLOR_GREY,"ID Accepted: Door1 Closing");
door1opened = false;
}
return 1;
}
if (strcmp("/door2", cmdtext, true, 10) == 0)
else if (IsPlayerInRangeOfPoint(playerid,4,-2126.1982421875, -868.763671875, -23.452175140381) && door2opened == true)
{
MoveObject(Gate2,-2126.1416015625, -870.2109375, -23.452175140381, 1);
SendClientMessage(playerid,COLOR_GREY,"ID Accepted: Door2 Opening");
door2opened = false;
return 1;
}
else
{
MoveObject(Gate2,-2126.1982421875, -868.763671875, -23.452175140381,1);
SendClientMessage(playerid,COLOR_GREY,"ID Accepted: Door2 Closing");
door2opened = false;
return 1;
}
return 1;
}