timer dont work
#1

hey guys ...
in my code a timer wont work can someone help me?
pawn Код:
//on top
forward GatesOpen();
forward GatesClose();

new side;
new fronta;
new frontb;
new frontc;

//public OnFilterScriptInit()
side = CreateObject(975, -1734.655151, 28.273335, 4.204377, 0.0000, 0.0000, 90.0000);
fronta = CreateObject(980, -1675.952881, 9.499218, 5.328079, 0.0000, 0.0000, 135.0000);
frontb = CreateObject(980, -1667.801880, 1.350600, 5.328079, 0.0000, 0.0000, 135.0000);
frontc = CreateObject(980, -1659.689209, -6.770653, 5.328079, 0.0000, 0.0000, 135.0000);

//a function
public ...(playerid)
{
    new string[128];
    new pname[24];
    GetPlayerName(playerid, pname, sizeof(pname));
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 451)
    {
        ...// my function
        SetTimer("GatesClose",3000,0);
        SetTimer("...", 120000, 0); // ... means the name of my functions (i dont want tell the name of this funtion)
    }
    return 1;
}

//the SetTimer("...", 120000, 0);
public ...(playerid) // ... only because i dont want tell his name
{
    SetPlayerCheckpoint(playerid, -1539.262817, 133.987518, 2.613937, 8);
    SendClientMessageToAll(YELLOW, "..."); // this text will displayed
    SetTimer("GatesOpen",8000,0); // this function will called
    return 1;
}

// called function SetTimer("GatesOpen",8000,0);
public GatesOpen()
{
    SendClientMessageToAll(RED,"hi ho"); // not displayed ( only to test if its work)
    MoveObject(side,-1734.655518, 37.611330, 4.204377, 3); // not work
    MoveObject(fronta,-1675.952881, 9.499218, 5.328060, 3); // not work
    MoveObject(frontb,-1667.801880, 1.350600, 5.328060, 3); // not work
    MoveObject(frontc,-1659.689209, -6.770653, 5.328060, 3); // not work
    return 0;
}
Someone know why its wont work?
Reply
#2

You have 3 different functions there that COULD be operated by a timer, but you have no timer that tells them to start.

Also two of the functions are called "..."

And there is no function called "GatesClosed", despite the fact you try to start it.
Reply
#3

the funtion GatesClose i havnt posted because my problem is the
pawn Код:
SetTimer("GatesOpen",8000,0);
that wont call the function
pawn Код:
public GatesOpen()
i need help to find out why he dont start "GatesOpen"
Reply
#4

Try this instead:

pawn Код:
SetTimer("GatesOpen",8000,false);
Reply
#5

hehe false is the same like 0
its dont work
Reply
#6

I find my timers work with false and not with 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)