Raised This Month: $120 Target: $400
 30% 

PrintHintText Timer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alphaearth
Member
Join Date: Feb 2018
Location: Turkey
Old 12-05-2018 , 17:04   PrintHintText Timer
Reply With Quote #1

I want printhinttext to appear for 8 seconds. Can you help me?

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <retakes>
#include <cstrike>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR "Czar, B3none"
#define PLUGIN_VERSION "1.5.0"

Handle cvar_red INVALID_HANDLE;
Handle cvar_green INVALID_HANDLE;
Handle cvar_blue INVALID_HANDLE;
Handle cvar_fadein INVALID_HANDLE;
Handle cvar_fadeout INVALID_HANDLE;
Handle cvar_xcord INVALID_HANDLE;
Handle cvar_ycord INVALID_HANDLE;
Handle cvar_holdtime INVALID_HANDLE;
Handle cvar_showterrorists INVALID_HANDLE;

bool showTerrorists;
int red;
int green;
int blue;
float fadein;
float fadeout;
float holdtime;
float xcord;
float ycord;

public 
Plugin myinfo =
{
    
name "Retake hud",
    
author PLUGIN_AUTHOR,
    
description "Bombsite Hud",
    
version PLUGIN_VERSION,
    
url "https://github.com/Czar-VG/RetakeSiteHud"
};

public 
void OnPluginStart()
{
    
LoadTranslations ("retakehud.phrases");
    
    
cvar_red CreateConVar("sm_redhud""255");
    
cvar_green CreateConVar("sm_greenhud""255");
    
cvar_blue CreateConVar("sm_bluehud""255");
    
cvar_fadein CreateConVar("sm_fadein""0.5");
    
cvar_fadeout CreateConVar("sm_fadeout""0.5");
    
cvar_holdtime CreateConVar("sm_holdtime""5.0");
    
cvar_xcord CreateConVar("sm_xcord""0.42");
    
cvar_ycord CreateConVar("sm_ycord""0.3");
    
cvar_showterrorists CreateConVar("sm_showterrorists""1");

    
AutoExecConfig(true"retakehud");
    
HookEvent("round_start"Event_OnRoundStart);
}

public 
void OnConfigsExecuted()
{
    
showTerrorists GetConVarBool(cvar_showterrorists);
    
red GetConVarInt(cvar_red);
    
green GetConVarInt(cvar_green);
    
blue GetConVarInt(cvar_blue);
    
fadein GetConVarFloat(cvar_fadein);
    
fadeout GetConVarFloat(cvar_fadeout);
    
holdtime GetConVarFloat(cvar_holdtime);
    
xcord GetConVarFloat(cvar_xcord);
    
ycord GetConVarFloat(cvar_ycord);
}

public 
void Event_OnRoundStart(Handle event, const char[] namebool dontBroadcast)
{
    
CreateTimer(1.0displayHud);
}

public 
Action displayHud(Handle timer)
{
    if (
IsWarmup())
    {
        return;
    }

    
char bombsite[8];
    
bombsite = (Retakes_GetCurrrentBombsite() == BombsiteA) ? "A" "B";

    for (
int i 1<= MaxClientsi++)
    {
        
int clientTeam GetClientTeam(i);
        if (
IsValidClient(i))
        {
            
SetHudTextParams(xcordycordholdtimeredgreenblue25500.25fadeinfadeout);

            if (
HasBomb(i))
            {
                
// We always want to show this one regardless
                
ShowHudText(i5"%T!""Planter Message");
            }
            else if (
clientTeam == CS_TEAM_CT || (clientTeam == CS_TEAM_T && showTerrorists))
            {
                
ShowHudText(i5"%T: %s"clientTeam == CS_TEAM_T "Terrorist Message" "Counter Terrorist Message"bombsite);
                
PrintHintText(i"<font color='#008000'>%s Bombsite:</font> \n<font color='#008000'>----- %s -----</font>"clientTeam == CS_TEAM_T "Defend" "Retake"bombsite);
            }
        }
    }
}

stock bool IsValidClient(int client)
{
    return 
client 0
        
&& client <= MaxClients
        
&& IsClientConnected(client)
        && 
IsClientInGame(client)
        && !
IsFakeClient(client);
}

stock bool HasBomb(int client)
{
    return 
GetPlayerWeaponSlot(client4) != -1;
}

stock bool IsWarmup()
{
    return 
GameRules_GetProp("m_bWarmupPeriod") == 1;

__________________
alphaearth 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 14:12.


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