Raised This Month: $ Target: $400
 0% 

Voting menu won't display.


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

Hey guys.
I made a PUG mode and a part of my PUG mode is the map voting, for some wierd reason when it reaches to this part of code (Public StartVote()) (and im sure it reaches to this part of code cuz i did before that it will print something if it reaches there.) it does nothing, and it doesn't display the menu it should display. Anybody finds bugs in this?

PHP Code:
/* Global Variables that are found in this code */

new gVoteMenu;
new 
gVotes[5];
new 
maps_ini_file[64]
new 
mapscounter
new mapsavailable[30][20]
new 
mapschosen[4][20]
new 
donemaps
new didgetmap

/* Global Variables .... */
public StartVote()
{
        if (
didgetmap == 0)
        {
                 
set_task(0.1"getmaps")
        }
    new 
rnd
    
    
while (donemaps != 4)
    {
        
rnd random(mapscounter)
        
        
copy(mapschosen[donemaps++], 19mapsavailable[rnd])
        
        
mapsavailable[rnd] = mapsavailable[--mapscounter]
    }        
    
    
gVoteMenu menu_create("\rChange map?""votemap");
    
    
    
menu_additem(gVoteMenumapschosen[0], "0"0)
    
menu_additem(gVoteMenumapschosen[1], "1"0)
    
menu_additem(gVoteMenumapschosen[2], "2"0)
    
menu_additem(gVoteMenumapschosen[3], "3"0)
    
menu_additem(gVoteMenu"\nExtend current map""4"0)
    
    new 
players[32], pnumtempid;
    
    
get_players(playerspnum"ch");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
client_print(tempidprint_chat"%s Please vote for the map you'd like to play in."PREFIX)
        
menu_display(tempidgVoteMenu);
    }

    
set_task(10.0"EndVote"); 
    return 
PLUGIN_HANDLED;

 
 
public 
votemap(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);
    
    
gVotes[voteid]++;
    return 
PLUGIN_HANDLED;
}

public 
getmaps()
{
    
get_configsdir(maps_ini_file63);
    
format(maps_ini_file63"%s/maps.ini"maps_ini_file);
    
    new 
mapsfile fopen(maps_ini_file"r")
    new 
linefortest[50]
    new 
maptoadd[25]
    
    while (!
feof(mapsfile))
    {
        
fgets(mapsfilelinefortest24)
        
mapscounter++
    }
    
    for (new 
zz<mapscounter z++)
    {
        
fgets(mapsfilemaptoadd24)
        
copy(mapsavailable[z], 24maptoadd)
    }
    
    
didgetmap++
    
set_task(0.1"StartVote")

Diegorkable is offline
 



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