31.05.2012, 13:39
pawn Код:
//on top
new IsOpened,Gate;
//OnGameModeinit
Gate = CreateObject(2990,2479.87768555,-1720.38623047,16.46136665,0.00000000,0.00000000,179.99993896);
IsOpened=0;
pawn Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
{
if(IsOpened == 1) return SendClientMessage(playerid, 0xFFFCFFF, " The Gate Is Already Opened ");
IsOpened =1;
SendClientMessage(playerid, 0xFFFCFFF, " You've opened the gate please close it ");
MoveObject(Gate,2479.87768555,-1720.38623047,10.46136665,3.00,0.00000000,0.00000000,179.99993896);
SetTimer("close", 10000, 0);//the gate will close after 10 seconds
return 1;
}
if (strcmp("/close", cmdtext, true, 10) == 0)
{
if(IsOpened == 0) return SendClientMessage(playerid, 0xFFFCFFF, " The Gate Is Already Closed ");
IsOpened =0;
MoveObject(Gate,2479.87768555,-1720.38623047,16.46136665,3.00,0.00000000,0.00000000,179.99993896);
}
pawn Код:
forward close();
public close()
{
If(IsOpened == 1)
{
MoveObject(Gate,2479.87768555,-1720.38623047,16.46136665,3.00,0.00000000,0.00000000,179.99993896);
IsOpened=0;
}
}