Help me
#1

I'm back again with this problem.
So if it's just me, however, goes well, but if there are more than 2 from round to round everything is spam, increasingly more, How can I do so in how not to be spam?



pawn Код:
if(strcmp(cmd, "/paintball", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(5.0, playerid, 1328.6179, -1557.9896, 13.8794))
            {

                SetPlayerPos(playerid, -973.7964, 1077.2219, 1345.0875);
                SetPlayerInterior(playerid, 10), SetPlayerHealth(playerid, 100);
                SendClientMessage(playerid, COLOR_WHITE, "Pentru a vota o mapa sau o arma foloseste comanda {0976B0}/vote.");
                pPlayers ++, PlayerKills[playerid] = 0, InPaintball[playerid] = 1, pVoted = 1, VotedMap[playerid] = 0, VotedGun[playerid] = 0;
                if(pRound == 1)
                {
                    if(pGun[1] == 1) { GivePlayerWeapon(playerid, 24, 500); }
                    if(pGun[2] == 1) { GivePlayerWeapon(playerid, 25, 500); }
                    if(pGun[3] == 1) { GivePlayerWeapon(playerid, 31, 500); }
                    if(pGun[4] == 1) { GivePlayerWeapon(playerid, 27, 500); }
                    if(pGun[5] == 1) { GivePlayerWeapon(playerid, 4, 500); }
                    if(pGun[6] == 1) { GivePlayerWeapon(playerid, 5, 500); }
                }
                SetTimer("StartPaintball", 20000, false);
            }
        }
        return 1;
    }

forward StartPaintball();
public StartPaintball()
{
    if(pPlayers == 1)
    {
        SetTimer("StartPaintball", 20000, 0);
        pRound = 0;
    }
    else if(pPlayers >= 2) { pRound = 1; }
   
    if(pRound == 1)
    {
        pRound = 1, pVoted = 0, pWinner = -1, pWinnerScore = -1; new string[256];
        if(VoteGuns[1] > VoteGuns[2] && VoteGuns[1] > VoteGuns[3] && VoteGuns[1] > VoteGuns[4] && VoteGuns[1] > VoteGuns[5] && VoteGuns[1] > VoteGuns[6])
        {
            format(string, sizeof(string), "Cea mai votata arma a fost: Deagle. (%d voturi)", VoteGuns[1]);
            PaintMessage(COLOR_WHITE, string);
            PaintWeapon(24, 500);
            pGun[1] = 1;
        }
        else if(VoteGuns[2] > VoteGuns[1] && VoteGuns[2] > VoteGuns[3] && VoteGuns[2] > VoteGuns[4] && VoteGuns[2] > VoteGuns[5] && VoteGuns[2] > VoteGuns[6])
        {
            format(string, sizeof(string), "Cea mai votata arma a fost: Shotgun. (%d voturi)", VoteGuns[2]);
            PaintMessage(COLOR_WHITE, string);
            PaintWeapon(25, 500);
            pGun[2] = 1;
        }
        else if(VoteGuns[3] > VoteGuns[1] && VoteGuns[3] > VoteGuns[2] && VoteGuns[3] > VoteGuns[4] && VoteGuns[3] > VoteGuns[5] && VoteGuns[3] > VoteGuns[6])
        {
            format(string, sizeof(string), "Cea mai votata arma a fost: M4. (%d voturi)", VoteGuns[3]);
            PaintMessage(COLOR_WHITE, string);
            PaintWeapon(31, 500);
            pGun[3] = 1;
        }
        else if(VoteGuns[4] > VoteGuns[1] && VoteGuns[4] > VoteGuns[2] && VoteGuns[4] > VoteGuns[3] && VoteGuns[4] > VoteGuns[5] && VoteGuns[4] > VoteGuns[6])
        {
            format(string, sizeof(string), "Cea mai votata arma a fost: Combat Shotgun. (%d voturi)", VoteGuns[4]);
            PaintMessage(COLOR_WHITE, string);
            PaintWeapon(27, 500);
            pGun[4] = 1;
        }
        else if(VoteGuns[5] > VoteGuns[1] && VoteGuns[5] > VoteGuns[2] && VoteGuns[5] > VoteGuns[3] && VoteGuns[5] > VoteGuns[4] && VoteGuns[5] > VoteGuns[6])
        {
            format(string, sizeof(string), "Cea mai votata arma a fost: Knife. (%d voturi)", VoteGuns[5]);
            PaintMessage(COLOR_WHITE, string);
            PaintWeapon(4, 500);
            pGun[5] = 1;
        }
        else if(VoteGuns[6] > VoteGuns[1] && VoteGuns[6] > VoteGuns[2] && VoteGuns[6] > VoteGuns[3] && VoteGuns[6] > VoteGuns[4] && VoteGuns[6] > VoteGuns[5])
        {
            format(string, sizeof(string), "Cea mai votata arma a fost: Baseball Bat. (%d voturi)", VoteGuns[6]);
            PaintMessage(COLOR_WHITE, string);
            PaintWeapon(5, 500);
            pGun[6] = 1;
        }
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(InPaintball[i] == 1 && pRound == 1)
            {
                SetPlayerHealth(i, 100);
            }
        }
        SetTimer("StopPaintball", 180000, false);
    }
    return 1;
}

forward StopPaintball();
public StopPaintball()
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(InPaintball[i] == 1)
        {
            new string[256];
            ResetPlayerWeapons(i);
            SetTimer("StartPaintball", 30000, 0);
            pGun[1] = 0, pGun[2] = 0, pGun[3] = 0, pGun[4] = 0, pGun[5] = 0, pGun[6] = 0;
            pRound = 0, PlayerKills[i] = 0, VotedMap[i] = 0, VotedGun[i] = 0, pVoted = 1;
            format(string, sizeof(string), "Castigatorul acestei runde de paintball este: %s - %d kills", GetName(pWinner), pWinnerScore);
            PaintMessage(COLOR_YELLOW, string);
            SetTimer("StartPaintball", 20000, false);
        }
    }
    return 1;
}

PHP код:
forward PaintMessage(colorstring[]);
public 
PaintMessage(colorstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
InPaintball[i] == 1)
            {
                
SendClientMessage(icolorstring);
            }
        }
    }

Reply


Messages In This Thread
Help me - by Edw - 30.12.2014, 17:27
Re: Help me - by Edw - 30.12.2014, 18:21
Re: Help me - by PowerPC603 - 30.12.2014, 18:26
Re : Help me - by MCZOFT - 30.12.2014, 18:31
Re: Help me - by Edw - 30.12.2014, 18:42
Re: Help me - by Cameltoe - 30.12.2014, 18:49
Re: Help me - by Edw - 30.12.2014, 19:01
Re: Help me - by Edw - 30.12.2014, 20:40
Re: Help me - by Cameltoe - 30.12.2014, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)