SA-MP Forums Archive
Timer problem help - 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: Timer problem help (/showthread.php?tid=258045)



Timer problem help - andruz99 - 28.05.2011

This timer is launched under OnPlayerConnect
Код:
SetTimerEx("eat", 108000000, true, "i", playerid); //30 minutes
Problem: the timer should run every 30 minutes but it doesn't it runs after like 1-2 minutes :S

Код:
forward eat(playerid);
public eat(playerid)
{

	if(PlayerInfo[playerid][pKasutajaK6htArv] > 0) 
	{
	PlayerInfo[playerid][pKasutajaK6htArv]--; 
	}

	if(PlayerInfo[playerid][pKasutajaK6htArv] == 0)
	if(SisseLogitud[playerid] == 1)
	{
	PlayerInfo[playerid][pKasutajaK6ht] = 0;//paneb kхhu tьhjaks
    new string2[256], pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string2, sizeof(string2), "* Kхht koriseb((%s))", pname);
	SendLocalMessage(playerid, LILLA, 15, string2);
	SendClientMessage(playerid,PUNANE,"Hoiatus! Sul on kхht tьhi, pead sццma muidu 20minuti pдrast satud haiglasse.");
	K6htTyhiSatubHaiglasse[playerid] = 1;
	}
	
	if(K6htTyhiSatubHaiglasse[playerid] == 1)
	{
	K6htTyhiSatubHaiglasse[playerid] = 0;
	new string2[256], pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string2, sizeof(string2), "* Kaotas teadvuse ((%s))", pname);
	SendLocalMessage(playerid, LILLA, 15, string2);
	format(string2, sizeof(string2), "* Kukkus pikali ((%s))", pname);
	SendLocalMessage(playerid, LILLA, 15, string2);
	format(string2, sizeof(string2), "* Kiirabi toimetab mehe haiglasse ((%s))", pname);
	SendLocalMessage(playerid, LILLA, 15, string2);

	PlayerInfo[playerid][pKasutajaHaiglas] = 1;
	PlayerInfo[playerid][pKasutajaHaiglaAeg] = 300;//Haiglaaeg kui kaua peab haiglas olema,5 minutit hetkel
	K6htTyhiSatubHaiglasse[playerid] = 1;

	SetPlayerInterior(playerid,0);
	SetPlayerVirtualWorld(playerid,0);
	SetPlayerPos(playerid,1900.0356,-1658.0906,13.5820);

	GetPlayerName(playerid, pname, sizeof(pname));
	format(string2, sizeof(string2), "* Tuleb teadvusele ((%s))", pname);
	SendLocalMessage(playerid, LILLA, 15, string2);
	format(string2, sizeof(string2), "* %s tхuseb voodist pьsti", pname);
	SendLocalMessage(playerid, LILLA, 15, string2);
	}
	



}



Re: Timer problem help - sleepysnowflake - 28.05.2011

https://sampwiki.blast.hk/wiki/SetTimerEx

Check that.


Re: Timer problem help - andruz99 - 28.05.2011

i Dont understand :S, atleast can you tell me whats wrong?, my timers millisecound time is correct and fuction also please help


Re: Timer problem help - sleepysnowflake - 28.05.2011

pawn Код:
return 1;
I do not see that ?

This forum requires that you wait 120 seconds between posts. Please try again in 4 seconds. Again ?!


Re: Timer problem help - andruz99 - 28.05.2011

Thanks thanks Thanks thanks thanks thanks thanks thanks thanks and thanks again.