Timer Help
#1

I have these two timers set up on this command:

Код:
CMD:startpretest(playerid, params[])
{
    if(isnull(params))
    {
        return SendClientMessage(playerid, -1, "USAGE: /startpretest [standard/trucker]");
    }
    if(!strcmp(params, "standard", true))
    {
        SetPlayerCheckpoint(playerid, 1020.6112,1376.4153,10.4650, 3.0);
        SetTimer("message", 220000, false);
        return 1;
    }
    if(!strcmp(params, "trucker", true))
    {
        SetPlayerCheckpoint(playerid, 1020.6112,1376.4153,10.4650, 3.0);
        SetTimer("messaget", 220000, false);
        return 1;
    }
    return 1;
}
I am trying to get it below, to kill both messaget and message when they reach the final checkpoint. How do I do this?

Код:
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1159.8411,1370.9576,10.4051))
    {
        DisablePlayerCheckpoint(playerid);
        SetVehicleToRespawn(1);
        SetVehicleToRespawn(2);
        SetVehicleToRespawn(3);
        KillTimer(0);
        KillTimer(1);
        SendClientMessage(playerid, COLOR_WHITE, "Congratulations! You passed the test!");
    }
	return 1;
}
Код:
public message()
{
    SendClientMessageToAll(COLOR_WHITE, "It has taken you longer than 3:40 to complete the test. Sorry, you failed. (/retrytest)");
}

public messaget()
{
    SendClientMessageToAll(COLOR_WHITE, "It has taken you longer than 3:40 to complete the test. Sorry, you failed. (/retrytest)");
}
Reply
#2

not sure if it'll help, but you can try adding:

pawn Код:
forward timername();
public timername()
{
    if(time == 0)
    {
        //code
       
    }
    return 1;
}
you may have to add an extra bit to the timer, like SetTimer("name",time,repeating,time);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)