Raised This Month: $ Target: $400
 0% 

Check last player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pob18
Member
Join Date: Jun 2014
Old 07-25-2014 , 20:31   Re: Check last player
Reply With Quote #1

does not work correctly

PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#include <fakemeta> 
#include <cstrike> 

new MuteTeams[CsTeams


public 
plugin_init() { 
     
    
register_forwardFM_Voice_SetClientListening"MetaSetClientListeningPre"


public 
MetaSetClientListeningPreinspkbool:CanListen 

    if( 
is_user_connectedspk ) && MuteTeams[cs_get_user_teamspk )] ) 
    { 
        
engfuncEngFunc_SetClientListeninginspkfalse 
        
forward_returnFMV_CELLfalse 
         
        return 
FMRES_SUPERCEDE
    } 
     
    return 
FMRES_IGNORED


public 
lastPlayer(id

    new 
menu menu_create("You are the last player in your team! ^nMute all players?""lastPlayer_handler"

    new 
TeamMuted[32
    
formatexTeamMuted32"Mute all is: \y%s", ( MuteTeams[CS_TEAM_T] && MuteTeams[CS_TEAM_CT] ) ? "Enabled" "Disabled" 
    
menu_additemmenuTeamMuted"0" 
     
    
formatexTeamMuted32"Mute T is: \y%s"MuteTeams[CS_TEAM_T] ? "Enabled" "Disabled" 
    
menu_additemmenuTeamMuted"1" 
     
    
formatexTeamMuted32"Mute CT is: \y%s"MuteTeams[CS_TEAM_CT] ? "Enabled" "Disabled" 
    
menu_additemmenuTeamMuted"2" 
     
    
menu_setpropmenuMPROP_EXITMEXIT_ALL 
    
menu_displayidmenu
     
    return 
PLUGIN_HANDLED



public 
lastPlayer_handleridmenuitem 

    if( 
item == MENU_EXIT 
    { 
        
menu_destroymenu 
     
        return 
PLUGIN_HANDLED
    } 
     
    new 
accesscallbackdata[6
    
menu_item_getinfomenuitemaccessdata5__callback 
         
    new 
choice str_to_numdata 
         
    switch( 
choice 
    { 
        case 
12
        { 
            
MuteTeams[CsTeams:choice] = !MuteTeams[CsTeams:choice
        } 
                 
        default: 
        { 
            if( !
MuteTeams[CS_TEAM_T] || !MuteTeams[CS_TEAM_CT] ) 
            { 
                
MuteTeams[CS_TEAM_T] = 
                MuteTeams
[CS_TEAM_CT] = 
            

                         
            else 
            { 
                
MuteTeams[CS_TEAM_T] = 
                MuteTeams
[CS_TEAM_CT] = 
            

        } 
    } 
         
    
lastPlayer(id
         
    return 
PLUGIN_HANDLED


public 
client_death(killervictimwpnindexhitplaceTK

    new 
cts[32], ts[32], ctsnumtsnum 
    get_players
(ctsctsnum"ae""CT"
    
get_players(tstsnum"ae""TERRORIST"
     
    if(
ctsnum == && tsnum == 1
    { 
        
// Show mute menu to the last player 
        
lastPlayer(killer
    } 

pob18 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 13:00.


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