AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [Help] hud message for spectator (https://forums.alliedmods.net/showthread.php?t=316282)

HelloBaBeS 05-15-2019 14:17

[Help] hud message for spectator
 
I have this code
PHP Code:

#include <sourcemod>   
#include <cstrike>   

public Plugin myinfo =   
{   
    
name "HUD",   
    
author "Nevvy",   
    
description "",   
    
version "",   
    
url "Nevvy.pl"   
};   

public 
OnPluginStart()   
{   
    
CreateTimer(5.0HUD_TIMER_REPEAT);   
}   

public 
Action HUD(Handle timer)   
{   
    for (new 
1<= MaxClientsi++)   
    {   
        if (
IsClientInGame(i))   
        {   
            
SetHudTextParams(-1.00.15.0025525525500.10.10.1);   
            
ShowHudText(i5"• YOUR MESSAGE •");   
        }   
    }   


I wanted the hud message to be displayed only to players who are on spectator team.
And, if possible, display only when teams are full (5vs5).

Can someone help me?
Sorry for my bad english. :3

NanoC 05-15-2019 18:55

Re: [Help] hud message for spectator
 
PHP Code:

#include <sourcemod>    
#include <cstrike>    

public Plugin myinfo =    
{    
    
name "HUD",    
    
author "Nevvy",    
    
description "",    
    
version "",    
    
url "Nevvy.pl"    
};    

public 
OnPluginStart()    
{    
    
CreateTimer(5.0HUD_TIMER_REPEAT);    
}    

public 
Action HUD(Handle timer)    
{    
    for (new 
1<= MaxClientsi++)    
    {    
        if (
IsClientInGame(i) && GetClientTeam(i) == 1)
        {    
            
SetHudTextParams(-1.00.15.0025525525500.10.10.1);    
            
ShowHudText(i5"• YOUR MESSAGE •");    
        }    
    }    



Nexd 05-16-2019 06:58

Re: [Help] hud message for spectator
 
Quote:

Originally Posted by NanoC (Post 2651813)
PHP Code:

#include <sourcemod>    
#include <cstrike>    

public Plugin myinfo =    
{    
    
name "HUD",    
    
author "Nevvy",    
    
description "",    
    
version "",    
    
url "Nevvy.pl"    
};    

public 
OnPluginStart()    
{    
    
CreateTimer(5.0HUD_TIMER_REPEAT);    
}    

public 
Action HUD(Handle timer)    
{    
    for (new 
1<= MaxClientsi++)    
    {    
        if (
IsClientInGame(i) && GetClientTeam(i) == 1)
        {    
            
SetHudTextParams(-1.00.15.0025525525500.10.10.1);    
            
ShowHudText(i5"• YOUR MESSAGE •");    
        }    
    }    



Quote:


I wanted the hud message to be displayed only to players who are on spectator team.
And, if possible, display only when teams are full (5vs5).
PHP Code:

#include <sourcemod>     
#include <cstrike>     

public Plugin myinfo =     
{     
    
name "HUD",     
    
author "Nevvy",     
    
description "",     
    
version "",     
    
url "Nevvy.pl"     
};     

public 
OnPluginStart()     
{     
    
CreateTimer(5.0HUD_TIMER_REPEAT);     
}     

public 
Action HUD(Handle timer)     
{
    
int ctcount GetClientsCountTeam(3);
    
int tcount GetClientsCountTeam(2);

    if(
ctcount == && tcount == 5)
    {
        for (new 
1<= MaxClientsi++)     
        {     
            if (
IsClientInGame(i) && GetClientTeam(i) == 1
            {     
                
SetHudTextParams(-1.00.15.0025525525500.10.10.1);     
                
ShowHudText(i5"• YOUR MESSAGE •");     
            }     
        } 
    }    
}

stock int GetClientsCountTeam(int team)
{
    
int j 0;
    for (
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && GetClientTeam(i) == team && !IsFakeClient(i))
        {
            
j++;
        }
    }
    return 
j;



HelloBaBeS 05-19-2019 17:48

Re: [Help] hud message for spectator
 
It's working 100%. Good work, thank you!


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

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