Jump to content
  • 0

Problema la Timer


Eduarth

Question

Salut sunt incepator in ale scriptului dar nu ma descurc la pasul functiei SetTimer/SetTimerEx.

Am un filescript, recunosc nu e facut de mine. In acest filescript este legat de PizzaJob si totul este in regula pana la checkpointuri unde nu pot adauga SetTimer/SetTimerEx, adica dupa ce intra in Checkpoint sa stea macar 10 secunde in el apoi in continuare sa ii de-a voie sa mearga la urmatorul checkpoint.

[pawn]public OnPlayerCommandText(playerid, cmdtext[])

{

    if (strcmp("/pizza", cmdtext, true, 10) == 0)

    {

        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)

        {

            PizzaJob[playerid] = 1;

            new name[MAX_PLAYER_NAME], string[48];

            GetPlayerName(playerid, name, sizeof(name));

            format(string, sizeof(string), "* %s is now a Pizzaboy.", name );

            SendClientMessageToAll(COLOR_YELLOW, string);

            SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);

            SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");

            return 1;

        }

        SendClientMessage(playerid, COLOR_RED,"You have to be on a pizza bike to start the job!");

    }

    return 0;

}[/pawn]

[pawn]public OnPlayerEnterCheckpoint(playerid)

{

    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)

    {

        if(PizzaJob[playerid] == 1)

{

PizzaJob[playerid] = 2;

SetPlayerCheckpoint(playerid,2012.4771,-1640.1229,13.1431,10);

                SendClientMessage(playerid,COLOR_YELLOW,"* Please go to the next mark, and you'll be payed!");

        return 1;

  }

        if(PizzaJob[playerid] == 2)

        {

        PizzaJob[playerid] = 3;

                SetPlayerCheckpoint(playerid,2387.0063,-1667.1498,13.1249,10);

                return 1;

        }

        if(PizzaJob[playerid] == 3)

        {

                PizzaJob[playerid] = 4;

                SetPlayerCheckpoint(playerid,2414.9255,-1649.6678,13.1305,10);

                  return 1;

        }

      ........

        if(PizzaJob[playerid] == 11){

            PizzaJob[playerid] = 0;

            DisablePlayerCheckpoint(playerid);

            SendClientMessage(playerid,COLOR_YELLOW,"* You have recieved $400 for delivering the pizzas.");

            GivePlayerMoney(playerid,400);

        }

    }

[/pawn]

Deci nu stiu cum sa un un Timer la fiecare Checkpoint.

Va rog frumos daca ma puteti ajuta, as ramane recunoscator. Multumesc.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

In fiecare checkpoint, inafara de cel care ii da banii, pui asta:

TogglePlayerControllable( playerid, false );
SetTimerEx( "CanGoTimer", 10000, false, "i", playerid );
Si undeva in script, oriunde, pui asta:
forward CanGoTimer( playerid );
public CanGoTimer( playerid )
{
   GameTextForPlayer( playerid, "Now you can go to the next checkpoint !", 3000, 4 );
   TogglePlayerControllable( playerid, true );
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.