View Single Post
Jackol1234
Senior Member
Join Date: Apr 2015
Old 06-05-2016 , 01:08   Re: [CSGO] Getting info from advanced votes
Reply With Quote #3

That makes a lot of sense. I didn't notice CLIENTINFO_CLIENT_INDEX in the include I was trying to write this from. Hopefully this works.

Edit: It worked now to translate the integer into a yes or no. I'm trying to understand this portion of the handler. I got this code from ckSurf and I'm confused how it gets this:

PHP Code:
if (item_info[0][VOTEINFO_ITEM_INDEX] == 0) {    // If the winner is Yes
        
votesYes item_info[0][VOTEINFO_ITEM_VOTES];
        if (
num_items 1) {
            
votesNo item_info[1][VOTEINFO_ITEM_VOTES];
        }
    }
    else {    
// If the winner is No
        
votesNo item_info[0][VOTEINFO_ITEM_VOTES];
        if (
num_items 1) {
            
votesYes item_info[1][VOTEINFO_ITEM_VOTES];
        }
    } 
What is this checking "item_info[0][VOTEINFO_ITEM_INDEX] == 0" in the if statement and why do the votesNo and votesYes change places depending on the outcome of the if statement?
__________________
Accepting PM's for private requests!

Last edited by Jackol1234; 06-05-2016 at 01:16.
Jackol1234 is offline