Checkpoint Timer
#2

Heres a really simple peice of code
pawn Код:
//put this at the top
new player cprun = 0, cprunTimer;

//put this wherever you want to start your checkpoint task
SetPlayerCheckpoint(playerid, x,y,z,size);

public OnPlayerEnterCheckpoint(playerid)
{
  if(cprun==0)
    {
      DisablePlayerCheckpoint(playerid);
        //this is the second checkpoint
        SetPlayerCheckpoint(playerid, x,y,z,size);
        //set timer for 20 seconds
        cprunTimer = SetTimerEx("Failcprun", 20000, 0, "d", playerid);
        cprun = 1;
    }else if(cprun==1)
    {
      KillTimer(cprunTimer);
        SendClientMessage(playerid, 0xAAAAAAAA, "you finished the Checkpoint Run");
    }
}

public Failcprun(playerid)
{
  SendClientMessage(playerid, 0xAAAAAAAA, "you failed the Checkpoint Run");
  DisablePlayerCheckpoint(playerid);
}
Reply


Messages In This Thread
Checkpoint Timer - by jesuschristlordandsavior - 06.02.2010, 22:27
Re: Checkpoint Timer - by mansonh - 07.02.2010, 03:00
Re: Checkpoint Timer - by jesuschristlordandsavior - 07.02.2010, 17:34
Re: Checkpoint Timer - by jesuschristlordandsavior - 07.02.2010, 17:42
Re: Checkpoint Timer - by mansonh - 07.02.2010, 21:11
Re: Checkpoint Timer - by jesuschristlordandsavior - 07.02.2010, 23:42
Re: Checkpoint Timer - by mansonh - 08.02.2010, 03:55
Re: Checkpoint Timer - by [Bm]rap45 - 08.02.2010, 04:12
Re: Checkpoint Timer - by mansonh - 08.02.2010, 04:13
Re: Checkpoint Timer - by [Bm]rap45 - 08.02.2010, 04:36

Forum Jump:


Users browsing this thread: 5 Guest(s)