Help me
#1

I have a problem, I still do to this message spam. How can I make just send playerii in Paintball? As if one takes only 1x and if 2 sends several times.
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(InPaintball[i] != 0)
        {
            pRound = 0;
            VotedMap[i] = 0;
            VotedGun[i] = 0;
            pVoted = 1;
            ResetPlayerWeapons(i);
            SetPlayerInterior(i, 10);
            SetPlayerVirtualWorld(i, 0);
            pGun[1] = 0, pGun[2] = 0, pGun[3] = 0, pGun[4] = 0, pGun[5] = 0, pGun[6] = 0;
            new sendername[MAX_PLAYER_NAME], string[256];
            GetPlayerName(pWinner, sendername, sizeof(sendername));
            format(string, sizeof(string), "Castigatorul acestei runde de paintball este: %s - %d kills", GetName(pWinner), pWinnerScore);
            SendClientMessage(i, COLOR_YELLOW, string);
            SetTimer("StartPaintball", 30000, 0);
        }
    }
PHP код:
[19:41:24Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:24Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:25Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:25Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:25Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:25Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:27Cea mai votata arma a fostDeagle. (2 voturi)
[
19:41:27Cea mai votata arma a fostDeagle. (2 voturi
Reply
#2

Not sure what you mean but if the problem is that it sends a message several times instead of once you should shows us the code that causes it.

The first piece of code sends a whole different message than you shows in the second part.
Reply
#3

Yes, instead of only once to send this message sends several times when many players. You must only send those in paintball
pawn Код:
forward StopPaintball();
public StopPaintball()
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(InPaintball[i] != 0)
        {
            pRound = 0;
            VotedMap[i] = 0;
            VotedGun[i] = 0;
            pVoted = 1;
            ResetPlayerWeapons(i);
            SetPlayerInterior(i, 10);
            SetPlayerVirtualWorld(i, 0);
            pGun[1] = 0, pGun[2] = 0, pGun[3] = 0, pGun[4] = 0, pGun[5] = 0, pGun[6] = 0;
            new sendername[MAX_PLAYER_NAME], string[256];
            GetPlayerName(pWinner, sendername, sizeof(sendername));
            format(string, sizeof(string), "Castigatorul acestei runde de paintball este: %s - %d kills", GetName(pWinner), pWinnerScore);
            SendClientMessage(i, COLOR_YELLOW, string);
            SetTimer("StartPaintball", 30000, 0);
        }
    }
    return 1;
}

    if(strcmp(cmd, "/paintball", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(5.0, playerid, 1328.6179, -1557.9896, 13.8794))
            {
                pPlayers ++;
                PlayerKills[playerid] = 0;
                InPaintball[playerid] = 1;
                pVoted = 1;
                VotedMap[playerid] = 0;
                VotedGun[playerid] = 0;
                SetPlayerHealth(playerid, 100);
                SetPlayerInterior(playerid, 10);
                SetPlayerPos(playerid, -973.7964, 1077.2219, 1345.0875);
                SendClientMessage(playerid, COLOR_WHITE, "Pentru a vota o mapa sau o arma foloseste comanda {0976B0}/vote.");
                if(pRound == 0) { SetTimer("StartPaintball", 30000, 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); }
                }
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                    if(InPaintball[i] != 0)
                    {
                        SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Reply
#4

Yeah but you showed us this:
Код:
[19:41:24] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:24] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:27] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:27] Cea mai votata arma a fost: Deagle. (2 voturi)
But not any of the code you send us created that message.
Reply
#5

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
Yeah but you showed us this:
Код:
[19:41:24] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:24] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:25] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:27] Cea mai votata arma a fost: Deagle. (2 voturi) 

[19:41:27] Cea mai votata arma a fost: Deagle. (2 voturi)
But not any of the code you send us created that message.
I gave it because it's exactly the same when run stoppaintball.

PHP код:
    foreach(Playeri
    {
            if(
InPaintball[i] != 0)
            {
                if(
VoteGuns[1] == && VoteGuns[2] == && VoteGuns[3] == && VoteGuns[4] == && VoteGuns[5] == && VoteGuns[6] == 0)
                {
                    
SendClientMessage(iCOLOR_WHITE"Runda de paintball a fost amanata cu 30 de secunde deoarece nu s-a votat nici o arma.");
                    
SetTimer("StartPaintball"300000);
                    return 
1;
                }
                if(
VoteGuns[1] > VoteGuns[2] && VoteGuns[1] > VoteGuns[3] && VoteGuns[1] > VoteGuns[4] && VoteGuns[1] > VoteGuns[5] && VoteGuns[1] > VoteGuns[6])
                {
                    
format(stringsizeof(string), "Cea mai votata arma a fost: Deagle. (%d voturi)"VoteGuns[1]);
                    
GivePlayerWeapon(i24500);
                    
pGun[1] = 1;
                }
                
SendClientMessage(iCOLOR_WHITEstring);
                
SetTimer("StopPaintball"1800000); 
Reply
#6

uppp
Reply
#7

help, please.
Reply
#8

pawn Код:
forward StopPaintball();
public StopPaintball()
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(InPaintball[i] != 0)
        {
            pRound = 0;
            VotedMap[i] = 0;
            VotedGun[i] = 0;
            pVoted = 1;
            ResetPlayerWeapons(i);
            SetPlayerInterior(i, 10);
            SetPlayerVirtualWorld(i, 0);
            pGun[1] = 0, pGun[2] = 0, pGun[3] = 0, pGun[4] = 0, pGun[5] = 0, pGun[6] = 0;
            new sendername[MAX_PLAYER_NAME], string[256];
            GetPlayerName(pWinner, sendername, sizeof(sendername));
            format(string, sizeof(string), "Castigatorul acestei runde de paintball este: %s - %d kills", GetName(pWinner), pWinnerScore);
            SendClientMessage(i, COLOR_YELLOW, string);
            SetTimer("StartPaintball", 30000, 0);
            break; // this breaks the loop from looping anymore..
        }
    }
    return 1;
}
Try.
Reply
#9

Also make spam, and look only at id 0. It happens and startpaintball function, do not understand why spam.
Help!

pawn Код:
forward StopPaintball();
public StopPaintball()
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(InPaintball[i] != 0)
        {
            pRound = 0;
            PlayerKills[i] = -1;
            VotedMap[i] = 0;
            VotedGun[i] = 0;
            pVoted = 1;
            ResetPlayerWeapons(i);
            SetPlayerInterior(i, 10);
            SetPlayerVirtualWorld(i, 0);
            pGun[1] = 0, pGun[2] = 0, pGun[3] = 0, pGun[4] = 0, pGun[5] = 0, pGun[6] = 0;
            new sendername[MAX_PLAYER_NAME], string[256];
            GetPlayerName(pWinner, sendername, sizeof(sendername));
            format(string, sizeof(string), "Castigatorul acestei runde de paintball este: %s - %d kills", GetName(pWinner), pWinnerScore);
            SendClientMessage(i, COLOR_YELLOW, string);
            SetTimer("StartPaintball", 30000, 0);
            break;
        }
    }
}
Reply
#10

Another solution would exsist?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)