PDA

View Full Version : Help


Edw
26/12/2014, 04:07 PM
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.

Edw
26/12/2014, 04:39 PM
upppp

jackx3rx
26/12/2014, 04:41 PM
Use an integer and whenever a player votes, up the value by one.


Votes += 1;

Edw
26/12/2014, 04:47 PM
I know how to do this, but do not understand how that weapon with the most votes will be the paintball.

jackx3rx
26/12/2014, 05:20 PM
Once the voting process is over, to get the one with the most votes simply try this:


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?
}

Edw
26/12/2014, 06:08 PM
fixed

Edw
26/12/2014, 06:38 PM
help please,

Write
26/12/2014, 06:40 PM
Make a global variable for each option.

Edw
26/12/2014, 06:43 PM
fixed

Edw
26/12/2014, 07:05 PM
fixed

Edw
26/12/2014, 07:20 PM
fixed