GameTextForAll Issue?
#1

I seem to be having a rather strange (slightly noobish) issue with a timer and a GameTextForAll. Here's the code:

pawn Код:
dcmd_takeoff(playerid, params[])
{
    #pragma unused params
    if(GetPlayerTeam(playerid) != TEAM_PILOT) return SendClientMessage(playerid, COLOUR_RED, "Only Pilots can use this command.");
    if(!IsPlayerInAnyVehicle(playerid) || !IsVehicleAircraft(GetVehicleModel(GetPlayerVehicleID(playerid)))) return SendClientMessage(playerid, COLOUR_RED, "You need to be in an aircraft to use this command.");
    GameTextForPlayer(playerid, "~g~Requesting Take Off", 2000, 5);
    new tmpString[45];
    format(tmpString, sizeof(tmpString), "~y~TOWER<>%s~n~~g~Take off granted", TailNumbers[GetPlayerVehicleID(playerid)]);
    SetTimerEx("TransmissionTimer", 5000, false, "s", playerid, tmpString);
    return 1;
}

dcmd_land(playerid, params[])
{
    #pragma unused params
    if(GetPlayerTeam(playerid) != TEAM_PILOT) return SendClientMessage(playerid, COLOUR_RED, "Only Pilots can use this command.");
    if(!IsPlayerInAnyVehicle(playerid) || !IsVehicleAircraft(GetVehicleModel(GetPlayerVehicleID(playerid)))) return SendClientMessage(playerid, COLOUR_RED, "You need to be in an aircraft to use this command.");
    GameTextForPlayer(playerid, "~g~Requesting to Land", 2000, 5);
    new tmpString[45];
    format(tmpString, sizeof(tmpString), "~y~TOWER<>%s~n~~g~Landing Granted", TailNumbers[GetPlayerVehicleID(playerid)]);
    SetTimerEx("TransmissionTimer", 5000, false, "s", playerid, tmpString);
    return 1;
}

//It is forwarded at the start of the script.
public TransmissionTimer(message[])
{
    GameTextForAll(message, 5000, 5);
}
//I have already fixed the incorrect parameter count in SetTimerEx (by removing the playerid parameter).

Basically, I call either command (/takeoff or /land) and I get the "Requesting to Take Off/Land" message. But, I never get the second message that should be sent from the timer. I can confirm that the timer is being called by using the print function.

I don't know else to explain it.

Has anyone got any ideas?

Thanks in advance,
Ash.

Oh, there's reputation (I think I can give around 4 points) in it for whoever can sort this, as it's really bugging me.
Reply


Messages In This Thread
GameTextForAll Issue? - by Ash. - 04.12.2011, 21:12
Re: GameTextForAll Issue? - by bartje01 - 04.12.2011, 21:51
Re: GameTextForAll Issue? - by MP2 - 04.12.2011, 22:07
Re: GameTextForAll Issue? - by Ash. - 05.12.2011, 06:02
Re: GameTextForAll Issue? - by MP2 - 05.12.2011, 06:41
Re: GameTextForAll Issue? - by [MG]Dimi - 05.12.2011, 06:41
Re: GameTextForAll Issue? - by Ash. - 05.12.2011, 15:09
Re: GameTextForAll Issue? - by Ash. - 05.12.2011, 15:44
Re: GameTextForAll Issue? - by MP2 - 05.12.2011, 15:46
Re: GameTextForAll Issue? - by Ash. - 05.12.2011, 15:51

Forum Jump:


Users browsing this thread: 1 Guest(s)