AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Selecting multiple people (https://forums.alliedmods.net/showthread.php?t=288530)

Riotline 10-02-2016 02:42

[TF2] Selecting multiple people
 
I want to select multiple people like @red, @blue, @all but I dont know how to.

Phil25 10-02-2016 02:49

Re: [TF2] Selecting multiple people
 
Command Filters

Riotline 10-02-2016 02:58

Re: [TF2] Selecting multiple people
 
Thanks

Riotline 10-02-2016 04:08

Re: [TF2] Selecting multiple people
 
Can someone give me an example of how to do it?

Phil25 10-02-2016 04:47

Re: [TF2] Selecting multiple people
 
PHP Code:

public void OnPluginStart(){
    
    
AddMultiTargetFilter("@letterB"TargetFilter_LetterB"Players who have the letter B in their name."false);

}

public 
void OnPluginEnd(){

    
RemoveMultiTargetFilter("@letterB"TargetFilter_LetterB);

}

public 
bool TargetFilter_LetterB(const char[] sPatternHandle hClients){

    
char sName[MAX_NAME_LENGTH];
    for(
int i 1<= MaxClientsi++){
    
        if(!
IsClientInGame(i))
            continue;
    
        
GetClientName(isNameMAX_NAME_LENGTH);
        if(
FindCharInString(sName'b') != -|| FindCharInString(sName'B') != -1)
            
PushArrayCell(hClientsi);
    
    }

    
//Return true if anything was found
    
return GetArraySize(hClients) > 0;



I'm not sure if RemoveMultiTargetFilter in OnPluginEnd is needed but I'd do it anyways.

Riotline 10-02-2016 07:10

Re: [TF2] Selecting multiple people
 
Lol i give up cus im bad... Can you give me an example for Red Targeting XD

Phil25 10-02-2016 07:17

Re: [TF2] Selecting multiple people
 
You mean for targeting the red team?

Riotline 10-02-2016 07:18

Re: [TF2] Selecting multiple people
 
Yes. Targeting the red team

BraveFox 10-02-2016 07:55

Re: [TF2] Selecting multiple people
 
Quote:

Originally Posted by Riotline (Post 2458552)
Yes. Targeting the red team

/slay @red
/mute @red
/kick @red
or
PHP Code:

ServerCommand("sm_slay @red"); 


Riotline 10-02-2016 19:27

Re: [TF2] Selecting multiple people
 
Ye but how do I make the MultiTargetFilter for red team like Phil25 said but specific for red team

also anyone know how to randomize only red team xD


All times are GMT -4. The time now is 15:11.

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