07.02.2010, 03:00
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);
}