Page 1 of 1

Cerere hud wave

Posted: 07 Jan 2019, 15:04
by MadnesOfJuice
As dori si eu un hud (sa fie sus pe centru) si sa vina in valuri(din stanga in dreapta)

Re: Cerere hud wave

Posted: 11 Jan 2019, 20:16
by NoNameAcs

Code: Select all

#include <sourcemod>
#include <sourcemod>  
#include <cstrike>

public Plugin:myinfo =
{
  name = "hud text",
  author = "coloneL",
  description = "hud TEXT Servers",
  version = "0.3",
  url = "colonel.cf"
};

#pragma semicolon 1

#pragma newdecls required

#define MessageCount    5

// Mesaje care se afișează la fiecare 5 secunde după începerea unei runde 
char sMessages[MessageCount][256] =  
{ 
    "FRAG.1tap.ro",
    "Owner 10 euro",
    "TEXT",
    "TEXT",
    "TEXT"
};

int j = 0;


public void OnPluginStart()
{
    HookEvent("round_start", OnRoundStart);
}

public Action OnRoundStart(Handle event, const char[] name, bool dontBroadcast)
{
    SetHudTextParams(-1.0, 0.1, 5.0, 255, 255, 255, 255, 0, 0.1, 0.1, 0.1); 
    CreateTimer(5.0, ShowHUD, _, TIMER_REPEAT);
    j = 0;
}


public Action ShowHUD(Handle timer)  
{
    if(j >= MessageCount) 
        return Plugin_Stop;
    
    for (int i = 1; i <= MaxClients; i++) 
    {
        if (IsClientInGame(i) && !IsFakeClient(i))  
        {
            ShowHudText(i, 5, sMessages[j]);
        }
    }  
    j++;
    return Plugin_Continue;
}