Raised This Month: $51 Target: $400
 12% 

Mute plugin error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-18-2023 , 04:20   Mute plugin error
Reply With Quote #1

This mute plugin is always giving me errors along these lines:

Player 14 is not in game.
[AMXX] Displaying debug trace (plugin "Mute.amxx", version "1.0")
[AMXX] Run time error 10: native error (native "menu_display")
[AMXX] [0] Mute.sma::clcmd_mute (line 73)
[AMXX] [1] Mute.sma::handled_show_players (line 173)

PHP Code:
62 public clcmd_mute(id)
63 {
64    static menu;
65    menu menu_create("\r[MUTE] \yMute menu""handled_clcmd_mute");
66    
67    menu_additem
(menu"Mute microphone""1"0);
68    menu_additem(menu"Mute chat""2"0);
69    
70    
if (get_user_flags(id) & ADMIN_MENU)
71        menu_additem(menu"Gag menu""3"0);
72    
73    menu_display
(idmenu);
74    return PLUGIN_HANDLED;
75 }


169 public handled_show_players(idmenuitem)
170 {
171    if (item == MENU_EXIT)
172    {
173        clcmd_mute(id);
174        return;
175    
Any ideas of what I need to add or take?
Let me know if you guys need the whole code! Thanks.
JuanitoAlimana is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-18-2023 , 05:16   Re: Mute plugin error
Reply With Quote #2

what that numbers saying on the left code LOL....
1: [0] Mute.sma::clcmd_mute (line 73)
pute also clcmd_mute handler/public

and all public of
Quote:
player with ID 14 is not in the game. This happens because you pass the ID to the menu_display() function when the player is not in the game or should be prob with handler
EDIT: Try it maybe

PHP Code:
public clcmd_mute(id)
{
    static 
menu;
    
    if (!
is_user_connected(id))
        return 
PLUGIN_HANDLED;
    
    
menu menu_create("\r[MUTE] \yMute menu""handled_clcmd_mute");
    
    
menu_additem(menu"Mute microphone""1"0);
    
menu_additem(menu"Mute chat""2"0);
    
    if (
get_user_flags(id) & ADMIN_MENU)
        
menu_additem(menu"Gag menu""3"0);
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;


Last edited by Fuck For Fun; 05-18-2023 at 05:19.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-18-2023 , 06:44   Re: Mute plugin error
Reply With Quote #3

it's also happening when the player is disconnecting while the menu is opened

i suggest you to check it like this

PHP Code:
if(is_user_connected(id))
            
menu_display(idmenu); 
lexzor is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-18-2023 , 15:36   Re: Mute plugin error
Reply With Quote #4

Quote:
Originally Posted by Fuck For Fun View Post
what that numbers saying on the left code LOL....
So you guys knew what line was line 73...
JuanitoAlimana is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-18-2023 , 15:37   Re: Mute plugin error
Reply With Quote #5

Quote:
Originally Posted by lexzor View Post
it's also happening when the player is disconnecting while the menu is opened

i suggest you to check it like this

PHP Code:
if(is_user_connected(id))
            
menu_display(idmenu); 
This seemed to work! I will test it thoroughly and I will get back to you. Thanks!
JuanitoAlimana is offline
jimcot
New Member
Join Date: May 2023
Old 05-24-2023 , 04:25   Re: Mute plugin error
Reply With Quote #6

Enjoy online streaming of exclusive TV shows & serials only on Disney+ Hotstar – the one-stop destination for latest TV shows online. www.hotstar.com/activate tv
jimcot 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 16:59.


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