17.07.2010, 19:09
I have a timer that checks to see if a trailer is attached to a vehicle every second (its only a very small script). If my trailer disconnects, the timer, which runs every second will pick it up and exectue a code. Here is the checking script.
And under the OnPlayerCommandText(playerid, cmdtext[]) command, (the actual command is "/work") i run the timer (after a lot of ifs)
EDIT: Do i then just have to call truckchecktime? Like this:
I also end (KillTimer) the timer when the player has completed the mission
This fails to work. Although compiles without warnings and errors.
I dont understand why it doesnt work.
Thanks, Ash!
pawn Код:
forward TruckCheck(playerid);
public TruckCheck(playerid)
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) == 0)
{
SendClientMessage(playerid, WORK, "Please reconnect your trailer");
}
if(IsPlayerInAnyVehicle(playerid) == 0)
{
SendClientMessage(playerid, WORK, "Get back in your truck!");
}
}
pawn Код:
new truckchecktime; // This is called way before the actual timer
truckchecktime = SetTimer("TruckCheck", 1000, true);
pawn Код:
truckchecktime;
pawn Код:
KillTimer(truckchecktime);
I dont understand why it doesnt work.
Thanks, Ash!


