Problem(error/warning): Problem
Dio skripte:
Prvo newovi
[pawn]new LottoSeIzvlaci = 0;
new Number[6];
new Listic1 = 0;
new Listic2 = 0;
new Listic3 = 0;
new Listic4 = 0;
new Listic5 = 0;
new Listic6 = 0;[/pawn]
[pawn]SetTimer("LottoStart",300000,true);[/pawn]
Ovaj timer nece da odradi msm hoce on al ovaj sljedeci nece
[pawn]forward LottoStart();
public LottoStart()
{
MakeNumber();
SetTimer("LottoIzvlacenje", 1000, 0);
LottoSeIzvlaci = 1;
return 1;
}[/pawn]
Kod LottoIzvlacenja
[pawn]forward LottoIzvlacenje();
public LottoIzvlacenje()
{
new Winning[MAX_PLAYERS];
foreach(Player, i)
{
for(new n = 0; n < 7; n++)
{
if(PlayerInfo[pLotto1] == Number[n])
{
Winning++;
Listic1++;
}
if(PlayerInfo[pLotto2] == Number[n])
{
Winning++;
Listic2++;
}
if(PlayerInfo[pLotto3] == Number[n])
{
Winning++;
Listic3++;
}
if(PlayerInfo[pLotto4] == Number[n])
{
Winning++;
Listic4++;
}
if(PlayerInfo[pLotto5] == Number[n])
{
Winning++;
Listic5++;
}
if(PlayerInfo[pLotto6] == Number[n])
{
Winning++;
Listic6++;
}
}
if(PlayerInfo[pLotto1] > 0 && PlayerInfo[pLotto2] > 0 && PlayerInfo[pLotto3] > 0 && PlayerInfo[pLotto4] > 0 && PlayerInfo[pLotto5] > 0 && PlayerInfo[pLotto6] > 0)
{
new lottostring1[256];
format(lottostring1, sizeof(lottostring1), ""GREENER"LOTTO "BELA"Vasa odigrana kombinacija: %d %d %d %d %d %d.", PlayerInfo[pLotto1],PlayerInfo[pLotto2],PlayerInfo[pLotto3],PlayerInfo[pLotto4],PlayerInfo[pLotto5],PlayerInfo[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 == 0)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Zao nam je,danas niste nista dobili,vise srece drugi put.");
}
if(Winning == 1)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 2000.");
g_NovacPlus(i, 2000);
}
if(Winning == 2)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 4000.");
g_NovacPlus(i, 4000);
}
if(Winning == 3)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 8000.");
g_NovacPlus(i, 8000);
}
if(Winning == 4)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 16000.");
g_NovacPlus(i, 16000);
}
if(Winning == 5)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 32000.");
g_NovacPlus(i, 32000);
}
if(Winning == 6)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 64000.");
g_NovacPlus(i, 64000);
}
}
PlayerInfo[pLotto1] = 0;
PlayerInfo[pLotto2] = 0;
PlayerInfo[pLotto3] = 0;
PlayerInfo[pLotto4] = 0;
PlayerInfo[pLotto5] = 0;
PlayerInfo[pLotto6] = 0;
PlayerInfo[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 = 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 == 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;
}[/pawn]
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!
Vako stavi
[pawn]forward LottoStart();
public LottoStart()
{
MakeNumber();
SetTimer("LottoIzvlacenje", 1000, 1);
LottoSeIzvlaci = 1;
return 1;
}[/pawn]
Citat: PazzOnee poslato Februar 17, 2019, 21:31:33 POSLE PODNE
Vako stavi
[pawn]forward LottoStart();
public LottoStart()
{
MakeNumber();
SetTimer("LottoIzvlacenje", 1000, 1);
LottoSeIzvlaci = 1;
return 1;
}[/pawn]
nista opet isto
[pawn]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[pLotto1] == Number[n])
{
Winning++;
Listic1++;
}
if(PlayerInfo[pLotto2] == Number[n])
{
Winning++;
Listic2++;
}
if(PlayerInfo[pLotto3] == Number[n])
{
Winning++;
Listic3++;
}
if(PlayerInfo[pLotto4] == Number[n])
{
Winning++;
Listic4++;
}
if(PlayerInfo[pLotto5] == Number[n])
{
Winning++;
Listic5++;
}
if(PlayerInfo[pLotto6] == Number[n])
{
Winning++;
Listic6++;
}
}
if(PlayerInfo[pLotto1] > 0 && PlayerInfo[pLotto2] > 0 && PlayerInfo[pLotto3] > 0 && PlayerInfo[pLotto4] > 0 && PlayerInfo[pLotto5] > 0 && PlayerInfo[pLotto6] > 0)
{
new lottostring1[256];
format(lottostring1, sizeof(lottostring1), ""GREENER"LOTTO "BELA"Vasa odigrana kombinacija: %d %d %d %d %d %d.", PlayerInfo[pLotto1],PlayerInfo[pLotto2],PlayerInfo[pLotto3],PlayerInfo[pLotto4],PlayerInfo[pLotto5],PlayerInfo[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 == 0)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Zao nam je,danas niste nista dobili,vise srece drugi put.");
}
if(Winning == 1)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 2000.");
g_NovacPlus(i, 2000);
}
if(Winning == 2)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 4000.");
g_NovacPlus(i, 4000);
}
if(Winning == 3)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 8000.");
g_NovacPlus(i, 8000);
}
if(Winning == 4)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 16000.");
g_NovacPlus(i, 16000);
}
if(Winning == 5)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 32000.");
g_NovacPlus(i, 32000);
}
if(Winning == 6)
{
SCM(i, -1, ""GREENER"LOTTO "BELA"Dobili ste 64000.");
g_NovacPlus(i, 64000);
}
}
PlayerInfo[pLotto1] = 0;
PlayerInfo[pLotto2] = 0;
PlayerInfo[pLotto3] = 0;
PlayerInfo[pLotto4] = 0;
PlayerInfo[pLotto5] = 0;
PlayerInfo[pLotto6] = 0;
PlayerInfo[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 = 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 == 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;
}[/pawn] debugaj ovako :D :D uradi opet svakako debuge
Rjesio sam problem je sto je number bio do 6 a u mne brojalo 7 valjda je to cim sam promjenio odmah ok
[pawn]for(new i = 0; i < 7; i++)[/pawn]