SA-MP Forums Archive
Timers*TSK TSK* - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timers*TSK TSK* (/showthread.php?tid=76366)



Timers*TSK TSK* - NEW_IE - 04.05.2009

Okay I have a huge problem with this. I want the Timer to be killed so the text won't keep showing up.

Take a look.

This is in OnGameModeInit.
Код:
  	fireplace2 = SetTimer("FireRiver",720000,false);//Next to River
Код:
public FireRiver(playerid)//Fire River
{
  if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 4)
  {
  SendClientMessage(playerid,0xFF8080FF,"_______[Fire Report]_______");
  SendClientMessage(playerid,0xFF8080FF,"Dispatch: A fire has been reported");
  SendClientMessage(playerid,0xFF8080FF,"Dispatch: No description Given.(CheckPoint)");
  SendClientMessage(playerid,0xFF8080FF,"Dispatch: Fire is at minimum levels..");
  SendClientMessage(playerid,0xFF8080FF,"Dispatch: All units in the area please respond.");
  PlayerPlaySound(playerid, 1085, 0, 0, 0);
  }
  KillTimer(fireplace2); //Suposed to kill the Timer so the *Fire Report* Text dosn't keep showing up
  river = SetTimer("Explotions2",5000,1);
  return true;
}
Код:
public Explotions2(playerid)
{
	randexp = SetTimer("Explode",500,1);
  PlayerPlaySound(playerid, 1142, 0, 0, 0);
  CreateExplosion(755.5777,-1607.7184,13.0503, 3, 5);
  if(FirePoints[playerid] > 1)
  {
  randexp = SetTimer("Explode",500,1);
  CreateExplosion(770.5340,-1605.5515,18.4278, 3, 6);
  }
  if(FirePoints[playerid] > 2)
  {
  randexp = SetTimer("Explode",500,1);
  CreateExplosion(769.5282,-1614.9204,13.3828, 3, 5);
  CreateExplosion(776.8428,-1609.8151,16.2789, 3, 7);
  }
  if(FirePoints[playerid] > 3)
  {
  randexp = SetTimer("Explode",500,1);
  CreateExplosion(771.7305,-1609.9564,19.6594, 3, 4);
	}
  if(FirePoints[playerid] > 4)
  {
  randexp = SetTimer("Explode",500,1);
  CreateExplosion(771.8530,-1609.1007,11.9060, 3, 9);
  CreateExplosion(755.5777,-1607.7184,13.0503, 3, 5);
  riverover = SetTimer("FireTwoOver",180000 ,1);
  }
  return true;
}
Код:
public FireTwoOver(playerid)
{

  KillTimer(riverover);
	KillTimer(randexp);
	StopMusic();
	KillTimer(river);
  return true;
}
Then if I put some text say. Here

Код:
public FireTwoOver(playerid)
{
  /* ..... */
  KillTimer(riverover);
	KillTimer(randexp);
	StopMusic();
	KillTimer(river);
  return true;
}
and have it be killed in that same public the timer won't stop and the text will keep spamming.


If you don't understand what Im trying to do please tell.

The main problem I have is the text keeps showing after I want the timer to be killed.

The other timers get killed fine.


Please Help me thanks.



Re: Timers*TSK TSK* - CJ101 - 04.05.2009

Код:
fireplace2 = SetTimer("FireRiver",720000,false);//Next to River
since it's false, the time normally will not repeat itself. So, you dont need killtime.

this should be this

Код:
public Explotions2(playerid)
{
	randexp = SetTimer("Explode",500,false);
  PlayerPlaySound(playerid, 1142, 0, 0, 0);
  CreateExplosion(755.5777,-1607.7184,13.0503, 3, 5);
  if(FirePoints[playerid] > 1)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(770.5340,-1605.5515,18.4278, 3, 6);
  }
  if(FirePoints[playerid] > 2)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(769.5282,-1614.9204,13.3828, 3, 5);
  CreateExplosion(776.8428,-1609.8151,16.2789, 3, 7);
  }
  if(FirePoints[playerid] > 3)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(771.7305,-1609.9564,19.6594, 3, 4);
	}
  if(FirePoints[playerid] > 4)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(771.8530,-1609.1007,11.9060, 3, 9);
  CreateExplosion(755.5777,-1607.7184,13.0503, 3, 5);
  riverover = SetTimer("FireTwoOver",180000 ,false);
  }
  return true;
}
try that.. let me kno what happens.


Re: Timers*TSK TSK* - NEW_IE - 04.05.2009

Quote:
Originally Posted by cj101
Код:
fireplace2 = SetTimer("FireRiver",720000,false);//Next to River
since it's false, the time normally will not repeat itself. So, you dont need killtime.

this should be this

Код:
public Explotions2(playerid)
{
	randexp = SetTimer("Explode",500,false);
  PlayerPlaySound(playerid, 1142, 0, 0, 0);
  CreateExplosion(755.5777,-1607.7184,13.0503, 3, 5);
  if(FirePoints[playerid] > 1)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(770.5340,-1605.5515,18.4278, 3, 6);
  }
  if(FirePoints[playerid] > 2)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(769.5282,-1614.9204,13.3828, 3, 5);
  CreateExplosion(776.8428,-1609.8151,16.2789, 3, 7);
  }
  if(FirePoints[playerid] > 3)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(771.7305,-1609.9564,19.6594, 3, 4);
	}
  if(FirePoints[playerid] > 4)
  {
  randexp = SetTimer("Explode",500,false);
  CreateExplosion(771.8530,-1609.1007,11.9060, 3, 9);
  CreateExplosion(755.5777,-1607.7184,13.0503, 3, 5);
  riverover = SetTimer("FireTwoOver",180000 ,false);
  }
  return true;
}
try that.. let me kno what happens.
Uh the Explotions stop the text keeps coming.

and what do you mean "this should be this"?


Re: Timers*TSK TSK* - CJ101 - 04.05.2009

well when you set those timers, the 1 on the end means that timer will repeat. if you set it to 0 or false, it will not repeat.


Re: Timers*TSK TSK* - NEW_IE - 04.05.2009

Yea I set the main one to false but it still repeats.
Like the FireReport text.