09.06.2015, 19:00
(
Последний раз редактировалось SpaceX; 09.06.2015 в 19:16.
Причина: added extra '{' by mistake and added a tip. Also, corrected the spacing
)
This is my attempt at your code..
I think this should work.
You should also check if the player has 500 cash or people would abuse your lotto game
Oh and ignore the guy who posted after me, he just copies stuff
I think this should work.
You should also check if the player has 500 cash or people would abuse your lotto game
pawn Код:
for(new b=1; b < 30; b++)
{
number = b;
for(new i=0,j=GetPlayerPoolSize() ; i <= j ; i++)
{
if(IsPlayerConnected(i) == 1)
{
if(PlayerInfo[i][pLottoNumber] == number)
{
numbertaken = 0; //true = 0
break;
}
else
{
numbertaken = 1; //false = 1
break;
}
}
} //for loop end
if(numbertaken == 0)
{
SendClientMessage(playerid,COLOR_ERROR,"Sorry All Lottery Numbers Haven Been Booked Already.");
}
else
{
PlayerInfo[playerid][pLottoNumber] = number;
format(string,sizeof(string),"You Have Successfully Taken Number "YELLOW"%d"WHITE", For Daily "GREEN"Lottery"WHITE" Draw At "YELLOW"18:00",number);
SendClientMessage(playerid,COLOR_WHITE,string);
GivePlayerCash(playerid,-500);
}