[Solved] npc Timers
#1

im having an issue with timers i want the timers just to delay on the first round . how can i fix this to order to not repeat on the next rounds?

here is the code:
Код:
#include <a_npc>

#define NUM_PLAYBACK_FILES 2
new gPlaybackFileCycle=0;

//------------------------------------------

main(){}

//------------------------------------------

NextPlayback()
{
	// Reset the cycle count if we reach the max
	if(gPlaybackFileCycle==NUM_PLAYBACK_FILES) gPlaybackFileCycle = 0;

	if(gPlaybackFileCycle==0) {
 	SetTimer("delay",900,0);
	}
	else if(gPlaybackFileCycle==1) {
	SetTimer("delay2",900,0);
	}

	gPlaybackFileCycle++;
}

//------------------------------------------

public OnRecordingPlaybackEnd()
{
  NextPlayback();
}

//------------------------------------------

public OnNPCEnterVehicle(vehicleid, seatid)
{
	NextPlayback();
}

//------------------------------------------

public OnNPCExitVehicle()
{
  StopRecordingPlayback();
  gPlaybackFileCycle = 0;
}

//------------------------------------------
forward delay(delay);
public delay(delay)
{
	StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER,"Packer2");
	KillTimer(delay);
}
forward delay2(delay2);
public delay2(delay2)
{
 	StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER,"Packer22");
	KillTimer(delay2);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)