Lotto 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)
+--- Thread: Lotto help (
/showthread.php?tid=342213)
Lotto help -
calin1996 - 13.05.2012
How i can make from 1 playable lotto number up to six,like,you can play with 1 number( 31 ex.),and i want to raise it to 6 numbers.
Lines:
pawn Код:
if(BizzInfo[24][bLocked] != 1)
{
new rand = 1 + random(49);
Lotto(rand);
}
Re: Lotto help -
calin1996 - 13.05.2012
pawn Код:
public Lotto(number)
{
new JackpotFallen = 0;
new string[256];
new winner[MAX_PLAYER_NAME];
format(string, sizeof(string), "LOTERIA 6/49: Numarul castigator de astazi este: %d.", number);
OOCOff(COLOR_WHITE, string);
new premiu = BizzInfo[24][bTill] / 4;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLottoNr] > 0)
{
if(PlayerInfo[i][pLottoNr] == number)
{
JackpotFallen = 1;
GetPlayerName(i, winner, sizeof(winner));
format(string, sizeof(string), "LOTERIE 6/49: %s a castigat premiul de %d RON.", winner, premiu);
OOCOff(COLOR_DBLUE, string);
format(string, sizeof(string), "* Ai castigat %d RON Cu biletul tau.", premiu);
SendClientMessage(i, COLOR_YELLOW, string);
//ConsumingMoney[i] = 1;
SafeGivePlayerMoney(i, premiu);
BizzInfo[24][bTill] -= premiu;
}
else
{
SendClientMessage(i, COLOR_WHITE, "* Biletul tau loto nu a fost castigator.");
}
}
PlayerInfo[i][pLottoNr] = 0;
}
}
if(JackpotFallen)
{
OnPropUpdate();
format(string, sizeof(string), "LOTERIA 6/49: Noul premiu incepe de la %d RON. (Cumparati bilete pentru a creste premiul,Intrarea este gratis!)", premiu);
OOCOff(COLOR_WHITE, string);
}
else
{
OnPropUpdate();
format(string, sizeof(string), "LOTERIA 6/49: Premiul este de %d RON. (Cumparati bilete pentru a creste premiul,Intrarea este gratis!)", premiu);
OOCOff(COLOR_DBLUE, string);
}
return 1;
}
pawn Код:
public SyncTime()
{
//new string[64];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
/*format(string, sizeof(string), "SERVER: The time is now %d:00 hours",tmphour);
BroadCast(COLOR_WHITE,string);*/
ghour = tmphour;
PayDay();
if(BizzInfo[24][bLocked] != 1)
{
new rand = 1 + random(49);
Lotto(rand);
}
Re: Lotto help -
calin1996 - 15.05.2012
A little help? I want to transform the system from 1 number to six numbers
Re: Lotto help -
ViniBorn - 15.05.2012
You use an array with 6 integers, and make the same thing with all them