04.12.2011, 21:12
(
Последний раз редактировалось Ash.; 05.12.2011 в 15:16.
)
I seem to be having a rather strange (slightly noobish) issue with a timer and a GameTextForAll. Here's the code:
//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.
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);
}
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.