if(elegatormoving) return SendClientMessage(playerid,color,"The elegator is moving, you have to wait.");
#include <Object>
#include <IsPlayerLAdmin>
new evevator;
new isopened4;
new Moving;
forward IsMoving();
public IsMoving()
{
Moving = 0;
}
public OnFilterScriptInit()
{
elevator = CreateStreamedObject(3095, -294.865967, 1866.683960, 41.285698, 0.0000, 0.0000, 34.3775);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(up, 2, cmdtext);
dcmd(down, 4, cmdtext);
return 1;
}
dcmd_up(playerid,params[])
{
#pragma unused params
if(isopened4 == 0)
{
if(Moving == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Wait For Lift To Come Back Down.");
return 1;}
MoveObject(elevator, -294.865967, 1866.683960, 150.285698, 5.00 );
SendClientMessage(playerid, 0xFF0000AA, "Elevator Rising");
isopened4 = 1;
Moving[playerid] = 1;
SetTimer("IsMoving", 10000, 0);// its 10 seconds before command ok to use again
}
else SendClientMessage(playerid, 0xFF0000AA, "Elevator Already Up!");
return 1;
}
dcmd_down(playerid,params[])
{
#pragma unused params
if(isopened4 == 1)
{
if(Moving == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Wait For Lift To Come Back up.");
return 1;}
MoveObject(elevator, -294.865967, 1866.683960, 41.285698, 10.00 );
SendClientMessage(playerid, 0xFF0000AA, "Elevator Lowering");
isopened4 = 0;
Moving[playerid] = 1;
SetTimer("IsMoving", 10000, 0);// its 10 seconds before its ok to use command again
}
else SendClientMessage(playerid, 0xFF0000AA, "Elevator Already Down!");
return 1;
}
Originally Posted by MenaceX^
pawn Code:
|