Raised This Month: $ Target: $400
 0% 

[HELP] Run time error 10:


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Michell
Member
Join Date: Oct 2015
Old 11-15-2015 , 09:15   [HELP] Run time error 10:
Reply With Quote #1

L 11/15/2015 - 07:188: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20151115.log")
L 11/15/2015 - 07:188: Plugin called menu_display when item=MENU_EXIT
L 11/15/2015 - 07:188: [AMXX] Displaying debug trace (plugin "premier.amxx", version "2016")
L 11/15/2015 - 07:188: [AMXX] Run time error 10: native error (native "menu_display")
L 11/15/2015 - 07:188: [AMXX] [0] premier.sma::StartVote (line 4253)


PHP Code:
public StartVote(){  
    
getmaps() 
    new 
rnd 
    

        
rnd random(gMapsCounter
        
copy(gMapsChosen[gDoneMaps++], 19gMapsAvailable[rnd]) 
        
gMapsAvailable[rnd] = gMapsAvailable[--gMapsCounter
    }         
    
    new 
title[64], extend[64]
    
formatex(titlecharsmax(title), "\y[ \wMenu - \rVoteMap \y]")
    
formatex(extendcharsmax(extend), "\yExtender mapa atual")
    
gGVoteMenu menu_create(title"votemap"); 
    
    new 
num[11
    for(new 
0gDoneMapsi++)  { 
        
num_to_str(inum10
        
menu_additem(gGVoteMenugMapsChosen[i], num0)
    }
    
menu_additem(gGVoteMenuextend"4"0
    
menu_setprop(gGVoteMenuMPROP_EXITMEXIT_NEVER)
    
    new 
players[32], pnumtempid
    
get_players(playerspnum"ch"); 
    for( new 
ii<pnumi++ ) { 
        
tempid players[i]; 
        
menu_display(tempidgGVoteMenu)        
    }
    
client_cmd(0"spk ^"get red(e80ninety(s45to check(e20) use bay(s18mass(e42cap(s50)^"")  
    new 
taskId NewTaskID()
    
set_task(10.0"EndVote"taskId);  
    return 
PLUGIN_HANDLED


Last edited by Michell; 11-15-2015 at 13:54.
Michell is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-15-2015 , 09:45   Re: [HELP] Run time error 10:
Reply With Quote #2

Show votemap function too.
__________________
Bugsy is offline
Michell
Member
Join Date: Oct 2015
Old 11-15-2015 , 10:00   Re: [HELP] Run time error 10:
Reply With Quote #3

TKS

Last edited by Michell; 11-15-2015 at 13:52.
Michell is offline
Michell
Member
Join Date: Oct 2015
Old 11-15-2015 , 10:05   Re: [HELP] Run time error 10:
Reply With Quote #4

LINE: 4253
PHP Code:
    menu_display(tempidgGVoteMenu
Michell is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-15-2015 , 10:28   Re: [HELP] Run time error 10:
Reply With Quote #5

It looks to me like a player is already viewing the menu and you try to show them the menu again. I was able to reproduce it to confirm.

To fix:
Add global variable:
PHP Code:
new bool:g_bIsViewingMenuMAX_PLAYERS ]; 
In StartVote, replace 'menu_display(tempid, gGVoteMenu)' with:
PHP Code:
if ( !g_bIsViewingMenutempid ] )
{
    
menu_display(tempidgGVoteMenu)        
    
g_bIsViewingMenutempid ] = true;

Add:
PHP Code:
public client_disconnectid )
{
    
g_bIsViewingMenuid ] = false;

Add to menu handler function:
Code:
public votemap(id, menu, item) {     g_bIsViewingMenu[ id ] = false;
__________________

Last edited by Bugsy; 11-15-2015 at 10:28.
Bugsy is offline
Reply


Thread Tools
Display Modes

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


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