Raised This Month: $32 Target: $400
 8% 

[Help] hud message for spectator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HelloBaBeS
Junior Member
Join Date: Dec 2018
Old 05-15-2019 , 14:17   [Help] hud message for spectator
Reply With Quote #1

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.
HelloBaBeS is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 05-15-2019 , 18:55   Re: [Help] hud message for spectator
Reply With Quote #2

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 •");    
        }    
    }    

__________________
NanoC is offline
Send a message via Skype™ to NanoC
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 05-16-2019 , 06:58   Re: [Help] hud message for spectator
Reply With Quote #3

Quote:
Originally Posted by NanoC View Post
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;

Nexd is offline
HelloBaBeS
Junior Member
Join Date: Dec 2018
Old 05-19-2019 , 17:48   Re: [Help] hud message for spectator
Reply With Quote #4

It's working 100%. Good work, thank you!
HelloBaBeS 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 04:14.


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