#1

How can command / paintvote?
I mean to put 3-4 weapons and you can vote in a dialogue but I can not figure out how pote choose server weapon with the highest number of votes.
Reply
#2

upppp
Reply
#3

Use an integer and whenever a player votes, up the value by one.

pawn Код:
Votes += 1;
Reply
#4

I know how to do this, but do not understand how that weapon with the most votes will be the paintball.
Reply
#5

Once the voting process is over, to get the one with the most votes simply try this:

pawn Код:
if(option1 > option2 || option1 > option3 || option1 > option4)
{
    // paintball gun will be option1
}
else if(option2 > option1 || option2 > option3 || option2 > option4)
{
    // paintball gun will be option2
}
else if(option3 > option1 || option3 > option2 || option3 > option4)
{
    // paintball gun will be option3
}
else if(option4 > option1 || option4 > option2 || option4 > option3)
{
    // paintball gun will be option4
}
else
{
    // it was a draw between 2 of them, so pick a random option?
}
Reply
#6

fixed
Reply
#7

help please,
Reply
#8

Make a global variable for each option.
Reply
#9

fixed
Reply
#10

fixed
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)