Raised This Month: $ Target: $400
 0% 

id of died player in team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-01-2014 , 20:51   id of died player in team
Reply With Quote #1

when the player is died and he is terrorist then wht will be his Team Name when he is spectating someone..i want to loop msg to all that player who are died in that team which is winner of that round..

PHP Code:
UNASSIGNED 0,
1,
CT 2,
SPECTATOR 
here is my code this works but not for players who died in winning team..
PHP Code:
public Round_End()
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsg21);
        
    if(
equal(textmsg"#Terrorists_Win"))
    {
        new 
iPlayers[32], iNumplayer
        
get_players(iPlayersiNum"a"); 
        
        for(new 
i<= iNumi++) 
        { 
            
player iPlayers[i]; 
            
            if(
get_user_team(player) == 1
            {
                
here is msg when t wins
            
}
            
            if(
get_user_team(player) == 2)
            {
                
when t wins this msg display to all ct players
            
}
        }
    }
    else if(
equal(textmsg"#CTs_Win"))
    {
        new 
iPlayers[32], iNumplayer
        
get_players(iPlayersiNum"a"); 
        
        for(new 
i<= iNumi++) 
        { 
            
player iPlayers[i]; 
            
            if(
get_user_team(player) == 2
            {
                
// here is msg when ct wins
            
}
            
            if(
get_user_team(player) == 1)
            {
                
// when ct wins this msg display to all terrorist players
            
}
        }
    }
    return 
PLUGIN_CONTINUE;

__________________
All my work is here

Last edited by xxxperts; 01-09-2014 at 03:05. Reason: Sorry Spelling Mistake Was Their
xxxperts is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 01-01-2014 , 21:59   Re: id of died player in team
Reply With Quote #2

Quote:
/* Sets indexes of players.
* Flags:
* "a" - don't collect dead players.
* "b" - don't collect alive players.
* "c" - skip bots.
* "d" - skip real players.
* "e" - match with team.
* "f" - match with part of name.
* "g" - ignore case sensitivity.
* "h" - skip HLTV.
* Example: Get all alive CTs: get_players(players,num,"ae","CT") */
Since you aim for dead players, so:
Code:
get_players(iPlayers, iNum, "b");

Use flag "b" instead of "a"


Also, or you can just do:
Code:
get_players(iPlayers, iNum, "be", "TERRORIST");

It means find all player who is died and in Terrorist team. so if you use that, you don't need check again the team inside the loop.
__________________
youtube:
@holla16

Last edited by 11922911; 01-01-2014 at 22:10.
11922911 is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-01-2014 , 23:27   Re: id of died player in team
Reply With Quote #3

TYSM..... i will try and response...
__________________
All my work is here
xxxperts is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-02-2014 , 16:21   Re: id of died player in team
Reply With Quote #4

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Test",AMXX_VERSION_STR,"AMXX Dev Team");
    
    
register_event("SendAudio","ev_SendAudio","a","2=%!MRAD_terwin","2=%!MRAD_ctwin");
}

public 
ev_SendAudio()
{
    new 
sTeam[22];
    
read_data(2,sTeam,charsmax(sTeam));
    
    new 
iPlayers[32],iNum,iPlayer;
    
get_players(iPlayers,iNum,"bche",(containi(sTeam,"terwin") != -1) ? "TERRORIST" "CT");
    
// b = DEAD Players, ch will remove BOTs and HLTVs, e Option will based on Teams
    
    
for(new i;iNum;i++)
    {
        
iPlayer iPlayers[i];
        
        
client_print
        
(
            
iPlayer,
            
print_chat,
            
"Dead Boys and Girls your team has won the round!"
        
);
    }

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 10:13.


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