Raised This Month: $ Target: $400
 0% 

Voting menu won't display.


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
NeedYourHelp
Member
Join Date: Dec 2011
Old 07-05-2012 , 14:23   Voting menu won't display.
#1

Hey guys.
some wierd reason when it reaches to this part of code (Public Mainmenu()) (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:
#include <amxmodx>

new szFile[64], diecount[33], arr[5];
new Array:
iMaps;
new 
Activated;

public 
plugin_init() {
set_task(3600.0"Vote",_,_,_"b");
}

public 
plugin_cfg() {
formatex(szFilesizeof szFile"addons/amxmodx/configs/maps.ini");
new 
iFile fopen(szFile"rt");
while(!
feof(iFile))
{
new 
szLine[256];
fgets(iFileszLinesizeof szLine 1);
ArrayPushString(iMapsszLine);
}
fclose(iFile);
}

public 
Vote() {
for(new 
i=0;i<4;i++)    arr[i] = 0

Activated 
1;

for(new 
i=1i<=get_maxplayers(); i++)
{
diecount[i] = 0
Mainmenu
(i);
}

set_task(15.0"Function");
}

public 
Mainmenu(id) {
if(
is_user_connected(id) && Activated)
{
new 
Mainmenu menu_create("\y[\rMap Vote\y] \w- \rIt's the time to choose map\y:""sub_Mainmenu")
new 
szLine[256], sub[65], iNum[11];

for(new 
i=0;i<4;i++)
{
ArrayGetString(iMapsrandom_num0file_sizeszFile) - ), szLinesizeof szLine 1);
num_to_str(iiNumsizeofiNum ) - 1);

format(sub64"\wMap: \r%s \w[\y%i\w]"szLinearr[i]);
menu_additem(MainmenusubiNum);
}

format(sub64"Extend current map \w[\y%i\w]"arr[4]);
menu_additem(Mainmenusub"4")

menu_display(idMainmenu);
return 
PLUGIN_HANDLED;
}
return 
PLUGIN_HANDLED;
}

public 
sub_Mainmenu(idMainmenuitem) {
new 
szName[33];
get_user_name(idszName31);
new 
Data[7], Name[64], AccessCallback;
menu_item_getinfo(MainmenuitemAccessData,5Name63Callback);

new 
Key str_to_num(Data);

if(
diecount[id] > 0)
{
client_print(idprint_chat"You are already vote!");
}

else
{
diecount[id]++;
arr[Key]++;

client_print(0print_chat"%s Vote For Map #%s!"szNamearr[Key]);
}

set_task(0.1,"Mainmenu",id);


Last edited by YamiKaitou; 07-05-2012 at 17:18. Reason: restored post
NeedYourHelp is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 07-05-2012 , 15:35   Re: Voting menu won't display.
#2

not sure if this is a problem but try trimming the newline chars after reading from file
jimaway is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-05-2012 , 17:18   Re: Voting menu won't display.
#3

Why delete your first post? ...
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-06-2012 , 13:09   Re: Voting menu won't display.
#4

lol
Santaaa is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-06-2012 , 13:14   Re: Voting menu won't display.
#5

NeedYourHelp, don't delete again your first post.

Locked to prevent edition.
__________________
Arkshine is offline
Closed Thread



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 15:18.


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