Raised This Month: $ Target: $400
 0% 

Voting menu won't display.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 11:57   Re: Voting menu won't display.
Reply With Quote #1

Thanks that works too, thanks alot Exolent

Now I have one more question. I used an .ini file that the pug will read from to spot if its after map vote or not, so after plugin_precache it wont do "type .rdy" again even if it was already and its after vote map, so it'll spot that if there's a specific written character I set, it'll start teams vote. The problem is, The teams vote doesnt work (teams vote = how the teams will be organized), I checked console and it says "Vote how you would like the teams to be organized" and then just says "Teams will be kept as they are", like it decides by itself the first option, and it doesnt even display the menu...

Here is the code:

PHP Code:
public TeamsVote()
 {        
    
    
rVoteMenu menu_create("\rHow do you want the teams organized?""votemap");
    
    
    
menu_additem(rVoteMenu"Keep current teams as they are.""0"0)
    
menu_additem(rVoteMenu"Random captains picking their team.""1"0)
    
menu_additem(rVoteMenu"Random teams.""2"0)
    ;
    
    new 
players[32], pnumtempid;
    
    
get_players(playerspnum"ch");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
client_print(tempidprint_chat"%s Please pick the way you'd like the teams to be organized."PREFIX)
        
menu_display(tempidrVoteMenu0);
    }

    
set_task(10.0"EndTeamsVote");
    return 
PLUGIN_HANDLED;
 }
 
 
public 
voteteams(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    
    new 
voteid str_to_num(data);
    
    
rVotes[voteid]++;
    return 
PLUGIN_HANDLED;
}
    
public 
EndTeamsVote()
{
    for(new 
xx<3x++)
    {
        for (new 
cc<c++)
        {
            if (
gVotes[x] >= gVotes[c])
            {
                if ((
== 2) && (== 2))
                {
                    
client_print(0print_chat"%s The teams will be kept as they are, match will now start."PREFIX)
                    
set_task(3.0"StartMatch")
                }
                
                else if ((
== 0) && (== 2))
                {
                    
client_print(0print_chat"%s Random Captains will be chosen in 10 seconds."PREFIX)
                    
set_task(10.0"RandomCpt")
                }
                
                else if ((
== 1) && (== 2))
                {
                    
client_print(0print_chat"%s Random teams will be set in 10 seconds."PREFIX)
                    
set_task(10.0"RandomTeams")
                }
                
            }
        }
    }

Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-20-2011 , 12:13   Re: Voting menu won't display.
Reply With Quote #2

PHP Code:
rVotes[voteid]++;
// ...
if (gVotes[x] >= gVotes[c]) 
Notice anything? Also, change that loop to the method I showed in my last post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-20-2011 , 12:28   Re: Voting menu won't display.
Reply With Quote #3

Your other problem is here:

PHP Code:
rVoteMenu menu_create("\rHow do you want the teams organized?""votemap");

//..

public voteteams(idmenuitem
What doesn't match?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode