Help me
#1

We're back again with this problem.
So, to be more explicit we made a paintball system and a system of vote for map and weapon, the problem is I do not understand how I could give gun that was most votes.

I made a variable weapons and one for maps.
new VoteGuns [8]; and new VoteMaps [2];


Thanks so much and please excuse my English.
Reply
#2

Help, please!
Reply
#3

Here's an example of what you can do. Assuming that there are only 2 guns to choose from.
pawn Код:
new gun1 = 0;
new gun2 = 0;

for(new i = 0; i < sizeof(VoteGuns); i++)
{
    if(VoteGuns[i] == 24) // Deagle
    {
        gun1++;
    }
    else // Spas12
    {
        gun2++;
    }
}

if(gun1 >= gun2)
{
    // give deagle to players
}
else
{
    // to give spas12 to players
}
Reply
#4

Fixed. ty all
Reply
#5

You need && instead of ||

Alao be sure you set the correct index for your number of different guns.
Like 6 different guns -> new guns[5];
Reply
#6

What is inattention ..
+repp man, thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)