How can i fix the timer problem?
#1

Hey, i have bout 12 or less/more timers, i want to know how to fix it so it wont SPAM..

here are the timers:

pawn Код:
public liftup1(playerid)
{
    SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 1 ... ");
    SetTimer("liftup2", 2500, 1);
    return 1;
}

public liftup2(playerid)
{
    SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 2 ... ");
    SetTimer("liftup3", 2500, 1);
    return 1;
}

public liftup3(playerid)
{
    SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 3 ... ");
    SetTimer("liftup4", 2500, 1);
    return 1;
}

public liftup4(playerid)
{
    SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 4 ... ");
    SetTimer("liftup", 2500, 1);
    return 1;
}

public liftup(playerid)
{
  elevused[playerid] = 1;
  SendClientMessage(playerid, 0xFF8080FF, " Elevator: Roof ... ");
  SendClientMessage(playerid, 0xFF8080FF, " Elevator doors will close in 5 seconds, please type /exit to get out ! ");
  SetTimer("liftdown", 5000, 1);
    return 1;
}

public liftdown(playerid)
{
    elevused[playerid] = 0;
    SendClientMessage(playerid, 0xFF0000FF, " Elevator doors are now closed. ");
    SetTimer("liftdown1", 2500, 1);
    return 1;
}
   
public liftdown1(playerid)
{
  SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 4 ... ");
    SetTimer("liftdown2", 2500, 1);
    return 1;
}

public liftdown2(playerid)
{
  SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 3 ... ");
    SetTimer("liftdown3", 2500, 1);
    return 1;
}

public liftdown3(playerid)
{
  SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 2 ... ");
    SetTimer("liftdown4", 2500, 1);
    return 1;
}

public liftdown4(playerid)
{
  SendClientMessage(playerid, 0xFF8080FF, " Elevator: Floor 1 / Basement ... ");
    elevused[playerid] = 1;
    SendClientMessage(playerid, 0xFF0000FF, " Elevator doors are now opened, please type /exit to get out, or else type /roof to go up again ");
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == liftupp)
    {
      GameTextForPlayer(playerid, "Hospital's Elevator ~n~ To enter the elevator type /enter ", 3000, 5);
    SetTimer("liftupdelay", 1000, 0);
    }
    return 1;
}
I hope you can help me
Reply


Messages In This Thread
How can i fix the timer problem? - by Moustafa - 26.07.2009, 16:20
Re: How can i fix the timer problem? - by Correlli - 26.07.2009, 16:21
Re: How can i fix the timer problem? - by Moustafa - 26.07.2009, 16:31
Re: How can i fix the timer problem? - by Moustafa - 26.07.2009, 16:41
Re: How can i fix the timer problem? - by member - 26.07.2009, 17:01

Forum Jump:


Users browsing this thread: 3 Guest(s)