AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_players work of both teams (https://forums.alliedmods.net/showthread.php?t=129676)

kostov 06-15-2010 14:23

get_players work of both teams
 
h1 :)

What will be the function get_players work of both teams. I tried:

PHP Code:

get_players(iPlayersiNum"ache" "CT" "TERRORIST"

But not working. Tnx :)

#8 SickneSS 06-15-2010 14:40

Re: get_players work of both teams
 
Why just don't use like that...

get_players( iPlayers , iNum , "ach" ) ?

drekes 06-15-2010 14:43

Re: get_players work of both teams
 
PHP Code:

new players[32], pnum
new tcountctcount
get_players
(playerspnum"ach"// No team or something

//example to count ct's and t's
for(new 0pnumi++)
{
    new 
tempid players[i]

    if(
get_user_team(tempid) == 1)
        
tcount++

    if(
get_user_team(tempid) == 2)
        
ctcount++
}

client_print(0print_chat"there are %i Terrorists and %i ct's alive"tcountctcount

http://www.amxmodx.org/funcwiki.php?go=func&id=174

kostov 06-15-2010 14:52

Re: get_players work of both teams
 
I want to work only between players from both teams and not between the two teams

drekes 06-15-2010 15:03

Re: get_players work of both teams
 
Quote:

Originally Posted by kostov (Post 1209689)
I want to work only between players from both teams and not between the two teams

how do you mean?
The code i gave you check works with both teams, then checks the teams in the loop

kostov 06-15-2010 15:07

Re: get_players work of both teams
 
This is SemiClip Deathrun Manager by Xpaw. I want to do only work between players in teams rather than between teams

PHP Code:

#include <amxmodx>
#include <fakemeta>

new g_iSemiClip[33]

public 
plugin_init()
{
    
register_plugin("""""")
    
    
register_forwardFM_StartFrame,    "FwdStartFrame");
    
register_forwardFM_AddToFullPack,    "FwdFullPack",   );
}

public 
FwdFullPackeseenthostflagsplayerpSet ) {
    if( 
player && g_iSemiClipent ] && g_iSemiCliphost ] ) {
        
set_esesES_SolidSOLID_NOT );
        
set_esesES_RenderModekRenderTransAlpha );
        
set_esesES_RenderAmt30 );}
    return 
FMRES_IGNORED;
}

public 
FwdStartFrame(id) {
    static 
iPlayers[32], iNumiPlayeriPlayer2ij;
    
get_players(iPlayersiNum"ache""CT")
    
arrayset(g_iSemiClip032);
    if(
iNum <= 1) return FMRES_IGNORED;
    for(
0iNumi++) {
        
iPlayer iPlayers];
        for(
0iNumj++) {
            
iPlayer2 iPlayers];
            if(
iPlayer == iPlayer2)
                continue;
            if(
g_iSemiClipiPlayer ] && g_iSemiClipiPlayer2 ] )
                continue;
            if(
fm_entity_rangeiPlayeriPlayer2 ) < 128) {
                
g_iSemiClipiPlayer ]    = true;
                
g_iSemiClipiPlayer2 ]    = true;}}}
    for(
0iNumi++) {
        
iPlayer iPlayers[i];
        
set_pev(iPlayerpev_solidg_iSemiClipiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX);}
    return 
FMRES_IGNORED;
}

stock Float:fm_entity_range(ent1ent2){
    new 
Float:origin1[3], Float:origin2[3]
    
pev(ent1pev_originorigin1)
    
pev(ent2pev_originorigin2)
    return 
get_distance_f(origin1origin2)



GXLZPGX 06-15-2010 18:39

Re: get_players work of both teams
 
Quote:

Originally Posted by kostov (Post 1209707)
This is SemiClip Deathrun Manager by Xpaw. I want to do only work between players in teams rather than between teams

PHP Code:

#include <amxmodx>
#include <fakemeta>

new g_iSemiClip[33]

public 
plugin_init()
{
    
register_plugin("""""")
    
    
register_forwardFM_StartFrame,    "FwdStartFrame");
    
register_forwardFM_AddToFullPack,    "FwdFullPack",   );
}

public 
FwdFullPackeseenthostflagsplayerpSet ) {
    if( 
player && g_iSemiClipent ] && g_iSemiCliphost ] ) {
        
set_esesES_SolidSOLID_NOT );
        
set_esesES_RenderModekRenderTransAlpha );
        
set_esesES_RenderAmt30 );}
    return 
FMRES_IGNORED;
}

public 
FwdStartFrame(id) {
    static 
iPlayers[32], iNumiPlayeriPlayer2ij;
    
get_players(iPlayersiNum"ache""CT")
    
arrayset(g_iSemiClip032);
    if(
iNum <= 1) return FMRES_IGNORED;
    for(
0iNumi++) {
        
iPlayer iPlayers];
        for(
0iNumj++) {
            
iPlayer2 iPlayers];
            if(
iPlayer == iPlayer2)
                continue;
            if(
g_iSemiClipiPlayer ] && g_iSemiClipiPlayer2 ] )
                continue;
            if(
fm_entity_rangeiPlayeriPlayer2 ) < 128) {
                
g_iSemiClipiPlayer ]    = true;
                
g_iSemiClipiPlayer2 ]    = true;}}}
    for(
0iNumi++) {
        
iPlayer iPlayers[i];
        
set_pev(iPlayerpev_solidg_iSemiClipiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX);}
    return 
FMRES_IGNORED;
}

stock Float:fm_entity_range(ent1ent2){
    new 
Float:origin1[3], Float:origin2[3]
    
pev(ent1pev_originorigin1)
    
pev(ent2pev_originorigin2)
    return 
get_distance_f(origin1origin2)



So your saying you don't want CT's to semiclip through T's?

Alucard^ 06-15-2010 20:53

Re: get_players work of both teams
 
Look into team semiclips, like Jon's HnS plugin...

kostov 06-16-2010 02:55

Re: get_players work of both teams
 
Quote:

Originally Posted by GXLZPGX (Post 1209928)
So your saying you don't want CT's to semiclip through T's?

I do not want to work between the teams but between players

K.K.Lv 06-16-2010 03:21

Re: get_players work of both teams
 
e...
I still don't understand what did you say !


All times are GMT -4. The time now is 14:49.

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