[HELP] SetTimerEx problem
#1

Hi, could someone please see if there's anything wrong in my code...
sometimes the timer works and sometimes it doesn't...

pawn Код:
new IllBillRoadTrain;
new IllBillTrailer;
new pIllBillMission1[MAX_PLAYERS];
new pIllBillMission2[MAX_PLAYERS];
new timer01;

forward CheckIBd1Trailer(vehicleid, trailerid, playerid);

dcmd_start(playerid, params[])
{
    #pragma unused params
    if(IsPlayerInVehicle(playerid, IllBillRoadTrain))
    {
      if(IsTrailerAttachedToVehicle(IllBillRoadTrain)) return SendClientMessage(playerid, RED,"[ERROR]: The truck already has a Trailer.");
        if(MissionInfo[playerid][IBd1] == 1) return SendClientMessage(playerid, RED,"[ERROR]: You've already completed this misison.");
        if(pIllBillMission1[playerid] == 1) return SendClientMessage(playerid, RED,"[ERROR]: You've already accepted this job.");
        IllBillTrailer = CreateVehicle(435, 890.5118,-26.0734,63.7832,156.4678, -1, -1, 1440000); //Trailer
        pIllBillMission1[playerid] = 1; //Ill Bill mission active!
        SendClientMessage(playerid, CYAN,"[Ill Bill]: Go get the trailer, Its placed somewhere in the Red County.");
        SendClientMessage(playerid, CYAN,"[Ill Bill]: Then You take it to the checkpoint and maybe there'l be a reward for ya!");
        SendClientMessage(playerid, CYAN,"[Ill Bill]: If you do not wish to complete the task type '/stop'.");
        SetPlayerCheckpoint(playerid, 890.5118, -26.0734, 63.7832, 4.0);
        timer01 = SetTimerEx("CheckIBd1Trailer", 2000, true, "i", 1);
    }
    return 1;
}

public CheckIBd1Trailer(vehicleid, trailerid, playerid)
{
    if(IsTrailerAttachedToVehicle(IllBillRoadTrain)) return SetPlayerCheckpoint(playerid, -221.9641, 2729.9717, 63.6978, 5.0);
    GameTextForPlayer(playerid, "~r~Get the trailer!!~n~~w~if you do not wish to complete the task~n~~r~type /exit", 2000, 3);
    SetVehicleParamsForPlayer(IllBillTrailer, playerid, 1, 0); //shows an arrow above the trailer
    DisablePlayerCheckpoint(playerid);
    return 1;
}
As I see it the timer should work fine...
But nothing happends...

Please help me.

~Lorrden
Reply
#2

bump,
sorry, I need an answer..
Reply
#3

timer01 = SetTimerEx("CheckIBd1Trailer", 2000, true, "i", 1);

The function you're referring to requires 3 params, you only supply 1 here...

It needs to be something like:

SetTimerEx("CheckIBd1Trailer", 2000, true, "ddd", vehicleid, trailerid, playerid);

Except you need to change vehicleid trailerid and playerid with the relevant bits of information to "send"
Reply
#4

well, could you please explain what those letters stand for...
I don't understand that yet :S
Reply
#5

Quote:
Originally Posted by ¤- Lorrden -¤
well, could you please explain what those letters stand for...
I don't understand that yet :S
When you use format you use %s to represent strings, %d for integers, %f for floats etc. In SetTimerEx you have to say what format each of the things are going to be. For example:

SetTimerEx("GenericFunction", 1000, 0, "sdf", string, integer, float);

A list of the letters can be found on the wiki article HERE
Reply
#6

nvm, i understand now! thanks i will try it now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)