Raised This Month: $ Target: $400
 0% 

[Solved]Get the player Index in a players menu...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 08-16-2010 , 17:51   Re: Get the player Index in a players menu...
Reply With Quote #7

Check this code..(I Made Something Like Mute Menu)

PHP Code:
new bool:vMuted[33][33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /mute","MuteMenu")
    
    
register_forward(FM_Voice_SetClientListening,"ForwardVoiceSetClientListening")
}

public 
ForwardVoiceSetClientListening(receiver,sender)
{
    if(
receiver == sender)
        return 
FMRES_IGNORED

    
if(vMuted[receiver][sender])
    {
        
engfunc(EngFunc_SetClientListening,receiver,sender,0)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED
}
public 
MuteMenu(id)
{
    new 
menu menu_create("\r[AMXX]\y Mute Menu :","MenuHandler")
    
    static 
name[32]
    static 
item[32]
    
    static 
temp[256]
    
    for(new 
1;<= get_maxplayers();i++)
    {
        if(
== id || !is_user_connected(i)) continue;
        
        
get_user_name(i,name,31)
        
num_to_str(i,item,31)
        
        
format(temp,255,"%s \d%s",name,vMuted[id][i] ? "(Muted)" "")
        
menu_additem(menu,temp,item)
    }
    
    
menu_display(id,menu)
    return 
PLUGIN_HANDLED
}
public 
MenuHandler(id,menu,item)
{
    if(
item == MENU_EXIT)
        
menu_destroy(menu)
        
    new 
iData[6]
    new 
iName[64]
    new 
Access
    
new Callback
    menu_item_getinfo
(menu,item,Access,iData,5,iName,63,Callback)
    
    new 
Choosed str_to_num(iData)
    
    if(
Choosed)
        
vMuted[id][/*???*/] = true
    
    menu_display
(id,menu)
    return 
PLUGIN_HANDLED

#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
 



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 21:53.


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