Lotto system
#5

I just threw this together quickly :O

pawn Код:
new price = 123, Float:dif; //change to your price amount
new count = 0;
new winmsg[70];
new pName[24];
new string[24];
strcat(winmsg, "Today's lotto winners: ", sizeof(winmsg));
for(new i=0; i<GetMaxPlayers(); i++)
{
  if(IsPlayerConnected(i) && Winner[i] == 1)
  {
    count++;
  }
}
if(count > 0)
{
  dif = price / count;
  price = floatround(dif, floatround_round);
  for(new i=0; i<GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i) && Winner[i] == 1)
    {
      GivePlayerMoney(i, price);
      SendClientMessage(i, 0x99999AA, "You won!");
      GetPlayerName(i, pName, 24);
      format(string,sizeof(string), "%s  ",pName);
      strcat(winmsg, string, sizeof(winmsg));
    }
  }
  SendClientMessageToAll(playerid, 0x99999AA ,winmsg);
}
Reply


Messages In This Thread
Lotto system - by BGMike - 16.01.2012, 14:54
Re: Lotto system - by thimo - 16.01.2012, 14:58
Re: Lotto system - by Sascha - 16.01.2012, 14:59
Re: Lotto system - by BGMike - 17.01.2012, 11:18
Re: Lotto system - by viper_viper - 17.01.2012, 11:38
Re: Lotto system - by BGMike - 17.01.2012, 14:19
Re: Lotto system - by cs_waller - 30.01.2012, 12:32
Re: Lotto system - by Sascha - 03.02.2012, 12:28

Forum Jump:


Users browsing this thread: 1 Guest(s)