SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 06/11/2009, 04:26 AM   #1
troy52192
Big Clucker
 
Join Date: Jul 2009
Location: USA,Fremont,CA,94538-1257
Posts: 183
Reputation: 2
Default [Solved] npc Timers

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:
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);
}
troy52192 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
timers Lajko1 Help Archive 6 09/12/2009 06:19 AM
[solved] npc Timers troy52192 Help Archive 0 06/11/2009 04:28 AM
[HELP] About Timers. cepiokas Help Archive 4 07/10/2009 05:06 PM
[HELP] timers argon Help Archive 8 26/07/2009 06:17 PM
[Solved] Will This Work? (Killing Timers) SiJ Help Archive 8 11/07/2009 02:35 PM


All times are GMT. The time now is 12:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.