Raised This Month: $ Target: $400
 0% 

Menu Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-19-2011 , 09:30   Menu Question
Reply With Quote #1

Hey guys,

I created a menu of map votes and I get in the error_log 2 wierd stuff:

These are the lines I am getting the first error on:

PHP Code:
// Some irrelevant public and code...

new players[32], pnumtempid
     
get_players(playerspnum"ch"); 

for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i]; 
        
ColorChat(tempidRED"%s ^3Please ^4vote^3 for the ^4map^3 you'd like to play in."PREFIX_COLOR
        
menu_display(tempidgVoteMenu); // Line 2804 
    
// Line 2805 
Error log:

Code:
L 11/19/2011 - 15:35:25: Plugin called menu_display when item=MENU_EXIT
L 11/19/2011 - 15:35:25: [AMXX] Displaying debug trace (plugin "adminslots.amxx")
L 11/19/2011 - 15:35:25: [AMXX] Run time error 10: native error (native "menu_display")
L 11/19/2011 - 15:35:25: [AMXX]    [0] pimpdr.sma::StartVote (line 2805)
L 11/19/2011 - 15:35:25: [AMXX]    [1] pimpdr.sma::StartVote (line 2804)
Why the hell is item = MENU_EXIT?!

Second error:

PHP Code:
// The public where it counts the votes... my question is about the menu_destroy so the rest isnt relevant....

menu_destroy(gVoteMenu)
    return 
PLUGIN_HANDLED 
log:

Code:
L 11/19/2011 - 15:35:31: Invalid menu id 11(12)
L 11/19/2011 - 15:35:31: [AMXX] Displaying debug trace (plugin "adminslots.amxx")
L 11/19/2011 - 15:35:31: [AMXX] Run time error 10: native error (native "menu_destroy")
L 11/19/2011 - 15:35:31: [AMXX]    [0] pimpdr.sma::EndVote (line 2925)
What wrong with destroying the menu after vote is done? and why is the menu id invalid? The variable of gVoteMenu is global btw...

Thanks for your time.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 11-19-2011 at 09:31.
Diegorkable is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-19-2011 , 14:35   Re: Menu Question
Reply With Quote #2

If you make a global menu, you can't destroy it.
Destroying a menu free's the memory of the menu, so it becomes invalid.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-19-2011 , 15:30   Re: Menu Question
Reply With Quote #3

Ahh I see...
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable 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 08:32.


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