Lotto system
#8

pawn Код:
new price = 123, Float:dif; //change to your price amount
new count = 0;
new winstring[150], name[MAX_PLAYER_NAME];
for(new i=0; i<GetMaxPlayers(); i++)
{
  if(IsPlayerConnected(i) && Winner[i] == 1)
  {
    count++;
  }
}
if(count > 0)
{
  format(winstring, sizeof(winstring), "Winners:");
  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(playerid, name, sizeof(name));
      format(winstring, sizeof(winstring), "%s %s", winstring, name);
    }
    SendClientMessageToAll(0x999999AA, winstring);
  }
}
if you still need it, this should work
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)