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-20-2014 , 20:38   Check last player
Reply With Quote #1

How to check every round the last player?
pob18 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-20-2014 , 20:40   Re: Check last player
Reply With Quote #2

What do you exactly mean by "last player"?
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
pob18
Member
Join Date: Jun 2014
Old 07-20-2014 , 20:42   Re: Check last player
Reply With Quote #3

When the last player is alone, no mather if TT/CT, do some function...
pob18 is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 07-20-2014 , 20:50   Re: Check last player
Reply With Quote #4

Study "miscstats.sma":
PHP Code:
public client_death(killervictimwpnindexhitplaceTK)
{
    new 
cts[32], ts[32], ctsnumtsnum
    get_players
(ctsctsnum"ae""CT")
    
get_players(tstsnum"ae""TERRORIST")
    
    if(
ctsnum == && tsnum == 1)
    {
        
// hi
    
}

Phant is offline
Send a message via ICQ to Phant
pob18
Member
Join Date: Jun 2014
Old 07-20-2014 , 20:54   Re: Check last player
Reply With Quote #5

Also, what are the function to mute ct/tt/all players?
pob18 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-20-2014 , 21:48   Re: Check last player
Reply With Quote #6

This is not the way this forums work. You are allowed to ask questions about scripting. And by that I dont mean random and multiple questions in one thread.
mottzi is offline
Send a message via MSN to mottzi
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-21-2014 , 06:16   Re: Check last player
Reply With Quote #7

OP, you can simply use get_playersnum() and check if it's 1 when you need. If you need to check if the player is alone in the server, you can do it when player disconnects. AFAIK it's called when player is already disconnected, but you can set a little task to avoid getting the wrong number.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Old 07-24-2014, 10:21
pob18
This message has been deleted by pob18.
pob18
Member
Join Date: Jun 2014
Old 07-25-2014 , 20:31   Re: Check last player
Reply With Quote #9

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
pob18
Member
Join Date: Jun 2014
Old 07-30-2014 , 12:24   Re: Check last player
Reply With Quote #10

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


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