Message spamming
#2

pawn Код:
public Estrazione()
{
    numerofortunato = random(50);
    new str[128];
    static WinnerID[MAX_PLAYERS];
    new Winners = 0;
    for(new i=0; i != MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
            if(Biglietto[i] == numerofortunato)
            {
                WinnerID[Winners++] = i;
                vincita = VINCITABASE+random(VINCITAEXTRA);
                GivePlayerMoney(i,vincita);
                format(str, sizeof(str), "Won at ~r~lottery~w~! (~g~%d ~w~CSCash)!",vincita);
                GameTextForPlayer(i,str,5000,4);
            }
        Biglietto[i] = 0;
    }
    if(Winners > 0)
    {
        new echo[128];
        for(new i=0,playerid=WinnerID[0]; i < Winners; i++,playerid=WinnerID[i])
        {
            GetPlayerName(playerid,nome,MAX_PLAYER_NAME);
            format(str,sizeof(str),"[LOTTO]: {8CE46C}%s (%d){FFFFFF} won the lottery! {C14124}(%d CSCash){FFFFFF} - Winning number: {C14124}%d{FFFFFF}",nome,playerid,vincita,numerofortunato);
            format(echo,sizeof(echo),"04,01[LOTTO]: %s (%d) won the lottery! (%d CSCash) - Winning number: %d",nome,playerid,vincita,numerofortunato);
            SCMTA(-1,str);
            IRC_GroupSay(gGroupID, IRC_CHANNEL, echo);
            IRC_GroupSay(gGroupID, IRC_ACHANNEL, echo);
        }
        SCMTA(-1, "** Another lotto draw in {8CE46C}5 minutes.");
    }
    else
    {
        format(str,sizeof(str),"[LOTTO]: For this draw lucky ticket number was: {C14124}%d{FFFFFF} - Nobody won -",numerofortunato);
        SCMTA(-1,str);
        format(str,sizeof(str),"04,01[LOTTO]: For this draw lucky ticket number was: %d - Nobody won -",numerofortunato);
        IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
        IRC_GroupSay(gGroupID, IRC_ACHANNEL, str);
        SCMTA(-1,"** Another lotto draw in {8CE46C}5 minutes.");
    }
    return 1;
}
Reply


Messages In This Thread
Message spamming - by Face9000 - 09.05.2013, 00:04
Re: Message spamming - by Jefff - 09.05.2013, 00:34
Re: Message spamming - by Face9000 - 09.05.2013, 11:06

Forum Jump:


Users browsing this thread: 2 Guest(s)