Moving Gate Help
#3

well make it so.

pawn Code:
#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;
}
Just edit the timer to the ammount of time it takes this should work if not let me no as i just quickly made this
Reply


Messages In This Thread
Moving Gate Help - by BP13 - 04.08.2009, 20:59
Re: Moving Gate Help - by MenaceX^ - 04.08.2009, 21:36
Re: Moving Gate Help - by shady91 - 04.08.2009, 21:47
Re: Moving Gate Help - by shady91 - 05.08.2009, 11:44

Forum Jump:


Users browsing this thread: 1 Guest(s)