Timer nece da odradi


Započeo rane, Februar 17, 2019, 19:39:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Problem
Dio skripte:
Prvo newovi
new LottoSeIzvlaci = 0;
new Number[6];
new Listic1 = 0;
new Listic2 = 0;
new Listic3 = 0;
new Listic4 = 0;
new Listic5 = 0;
new Listic6 = 0;

SetTimer("LottoStart",300000,true);

Ovaj timer nece da odradi msm hoce on al ovaj sljedeci nece
forward LottoStart();
public LottoStart()
{
	MakeNumber();
	SetTimer("LottoIzvlacenje", 1000, 0);
	LottoSeIzvlaci = 1;
	return 1;
}

Kod LottoIzvlacenja
forward LottoIzvlacenje();
public LottoIzvlacenje()
{
	new Winning[MAX_PLAYERS];
	foreach(Player, i)
	{
		for(new n = 0; n < 7; n++)
		{
        	if(PlayerInfo[i][pLotto1] == Number[n])
        	{
            	Winning[i]++;
            	Listic1++;
        	}
         	if(PlayerInfo[i][pLotto2] == Number[n])
			{
            	Winning[i]++;
            	Listic2++;
            }
            if(PlayerInfo[i][pLotto3] == Number[n])
            {
            	Winning[i]++;
            	Listic3++;
            }
            if(PlayerInfo[i][pLotto4] == Number[n])
            {
            	Winning[i]++;
            	Listic4++;
            }
            if(PlayerInfo[i][pLotto5] == Number[n])
            {
            	Winning[i]++;
            	Listic5++;
           }
           if(PlayerInfo[i][pLotto6] == Number[n])
           {
           		Winning[i]++;
           		Listic6++;
           }
		}
        if(PlayerInfo[i][pLotto1] > 0 && PlayerInfo[i][pLotto2] > 0 && PlayerInfo[i][pLotto3] > 0 && PlayerInfo[i][pLotto4] > 0 && PlayerInfo[i][pLotto5] > 0 && PlayerInfo[i][pLotto6] > 0)
		{
        	new lottostring1[256];
        	format(lottostring1, sizeof(lottostring1), ""GREENER"LOTTO "BELA"Vasa odigrana kombinacija: %d %d %d %d %d %d.", PlayerInfo[i][pLotto1],PlayerInfo[i][pLotto2],PlayerInfo[i][pLotto3],PlayerInfo[i][pLotto4],PlayerInfo[i][pLotto5],PlayerInfo[i][pLotto6]);
            SCM(i, -1, lottostring1);
            new lottostring[256];
            format(lottostring, sizeof(lottostring), ""GREENER"LOTTO "BELA"Dobitna kombinacija: %d %d %d %d %d %d.", Number[0], Number[1], Number[2], Number[3], Number[4], Number[5]);
            SCM(i, -1, lottostring);
            lottostring = "\0";
		    Listic1 = 0;
            Listic2 = 0;
            Listic3 = 0;
            Listic4 = 0;
            Listic5 = 0;
            Listic6 = 0;
        	if(Winning[i] == 0)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Zao nam je,danas niste nista dobili,vise srece drugi put.");
            }
            if(Winning[i] == 1)
            {
                SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 2000.");
                g_NovacPlus(i, 2000);
            }
            if(Winning[i] == 2)
            {
                SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 4000.");
                g_NovacPlus(i, 4000);
            }
            if(Winning[i] == 3)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 8000.");
                g_NovacPlus(i, 8000);
            }
            if(Winning[i] == 4)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 16000.");
                g_NovacPlus(i, 16000);
			}
            if(Winning[i] == 5)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 32000.");
                g_NovacPlus(i, 32000);
			}
            if(Winning[i] == 6)
            {
                SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 64000.");
                g_NovacPlus(i, 64000);
			}
        }
        PlayerInfo[i][pLotto1] = 0;
        PlayerInfo[i][pLotto2] = 0;
        PlayerInfo[i][pLotto3] = 0;
        PlayerInfo[i][pLotto4] = 0;
        PlayerInfo[i][pLotto5] = 0;
        PlayerInfo[i][pLotto6] = 0;
        PlayerInfo[i][pLottoListic] = 0;
	}
	LottoSeIzvlaci = 0;
	new stringer[80];
	format(stringer,sizeof(stringer),""GREENER"LOTTO "BELA"Zavrseno je lotto %d",LottoSeIzvlaci);
	AdminGameMaster(-1, stringer);
	
}

stock MakeNumber()
{
	for(new i = 0; i < 7; i++)
	{
		Number[i] = Random_Number_Generator(i,1,39);
	}
	return (true);
}
stock Random_Number_Generator(curid,min,max)
{
  	new Num_Var_Index;

    Num_Var_Index = randomExx(min, max); //randomEx

    for(new i = 0; i < curid; i++)
	{
      if(Number[i] == Num_Var_Index) return Random_Number_Generator(curid,min,max);
    }

    return Num_Var_Index;
}

stock randomEx(min,max)
{
	return (min+random(max));
}

stock randomExx(const iMin, const iMax)
{
	return random(iMax - iMin) + iMin;
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): Nece da odradi stavljao sam print u djelove i odradi ovaj LottoStart i ispise print ali stavljao sam i pod LottoIzvlacenje i nece!
Poslednja Izmena: Februar 19, 2019, 18:43:23 POSLE PODNE od Bašovski

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Vako stavi
forward LottoStart();
public LottoStart()
{
	MakeNumber();
	SetTimer("LottoIzvlacenje", 1000, 1);
	LottoSeIzvlaci = 1;
	return 1;
}

Citat: PazzOnee poslato Februar 17, 2019, 21:31:33 POSLE PODNE
Vako stavi
forward LottoStart();
public LottoStart()
{
	MakeNumber();
	SetTimer("LottoIzvlacenje", 1000, 1);
	LottoSeIzvlaci = 1;
	return 1;
}

nista opet isto

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

forward LottoStart();
public LottoStart()
{
	MakeNumber();
	return 1;
}



forward LottoIzvlacenje();
public LottoIzvlacenje()
{
	print("debug lottoizvlacenje pocetak");
	new Winning[MAX_PLAYERS];
	foreach(Player, i)
	{
		for(new n = 0; n < 7; n++)
		{
        	if(PlayerInfo[i][pLotto1] == Number[n])
        	{
            	Winning[i]++;
            	Listic1++;
        	}
         	if(PlayerInfo[i][pLotto2] == Number[n])
			{
            	Winning[i]++;
            	Listic2++;
            }
            if(PlayerInfo[i][pLotto3] == Number[n])
            {
            	Winning[i]++;
            	Listic3++;
            }
            if(PlayerInfo[i][pLotto4] == Number[n])
            {
            	Winning[i]++;
            	Listic4++;
            }
            if(PlayerInfo[i][pLotto5] == Number[n])
            {
            	Winning[i]++;
            	Listic5++;
           }
           if(PlayerInfo[i][pLotto6] == Number[n])
           {
           		Winning[i]++;
           		Listic6++;
           }
		}
        if(PlayerInfo[i][pLotto1] > 0 && PlayerInfo[i][pLotto2] > 0 && PlayerInfo[i][pLotto3] > 0 && PlayerInfo[i][pLotto4] > 0 && PlayerInfo[i][pLotto5] > 0 && PlayerInfo[i][pLotto6] > 0)
		{
        	new lottostring1[256];
        	format(lottostring1, sizeof(lottostring1), ""GREENER"LOTTO "BELA"Vasa odigrana kombinacija: %d %d %d %d %d %d.", PlayerInfo[i][pLotto1],PlayerInfo[i][pLotto2],PlayerInfo[i][pLotto3],PlayerInfo[i][pLotto4],PlayerInfo[i][pLotto5],PlayerInfo[i][pLotto6]);
            SCM(i, -1, lottostring1);
            new lottostring[256];
            format(lottostring, sizeof(lottostring), ""GREENER"LOTTO "BELA"Dobitna kombinacija: %d %d %d %d %d %d.", Number[0], Number[1], Number[2], Number[3], Number[4], Number[5]);
            SCM(i, -1, lottostring);
            lottostring = "\0";
		    Listic1 = 0;
            Listic2 = 0;
            Listic3 = 0;
            Listic4 = 0;
            Listic5 = 0;
            Listic6 = 0;
        	if(Winning[i] == 0)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Zao nam je,danas niste nista dobili,vise srece drugi put.");
            }
            if(Winning[i] == 1)
            {
                SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 2000.");
                g_NovacPlus(i, 2000);
            }
            if(Winning[i] == 2)
            {
                SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 4000.");
                g_NovacPlus(i, 4000);
            }
            if(Winning[i] == 3)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 8000.");
                g_NovacPlus(i, 8000);
            }
            if(Winning[i] == 4)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 16000.");
                g_NovacPlus(i, 16000);
			}
            if(Winning[i] == 5)
            {
            	SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 32000.");
                g_NovacPlus(i, 32000);
			}
            if(Winning[i] == 6)
            {
                SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 64000.");
                g_NovacPlus(i, 64000);
			}
        }
        PlayerInfo[i][pLotto1] = 0;
        PlayerInfo[i][pLotto2] = 0;
        PlayerInfo[i][pLotto3] = 0;
        PlayerInfo[i][pLotto4] = 0;
        PlayerInfo[i][pLotto5] = 0;
        PlayerInfo[i][pLotto6] = 0;
        PlayerInfo[i][pLottoListic] = 0;
	}
	LottoSeIzvlaci = 0;
	new stringer[80];
	format(stringer,sizeof(stringer),""GREENER"LOTTO "BELA"Zavrseno je lotto %d",LottoSeIzvlaci);
	AdminGameMaster(-1, stringer);
	print("debug lottoizvlacenje kraj");
	
}

stock MakeNumber()
{
	print("debug makenumber početak");
	for(new i = 0; i < 7; i++)
	{
		Number[i] = Random_Number_Generator(i,1,39);
	}
	print("debug makenumber");
	LottoIzvlacenje();
	LottoSeIzvlaci = 1;
	return (true);
}
stock Random_Number_Generator(curid,min,max)
{
  	new Num_Var_Index;

    Num_Var_Index = randomExx(min, max); //randomEx

    for(new i = 0; i < curid; i++)
	{
      if(Number[i] == Num_Var_Index) return Random_Number_Generator(curid,min,max);
    }

    return Num_Var_Index;
}

stock randomEx(min,max)
{
	return (min+random(max));
}

stock randomExx(const iMin, const iMax)
{
	return random(iMax - iMin) + iMin;
}
debugaj ovako :D :D uradi opet svakako debuge
69

Rjesio sam problem je sto je number bio do 6 a u mne brojalo 7 valjda je to cim sam promjenio odmah ok
for(new i = 0; i < 7; i++)


[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi