Raised This Month: $51 Target: $400
 12% 

Req*** server hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GUCCICSGO
Junior Member
Join Date: Jan 2019
Location: IASI
Old 01-22-2019 , 08:54   Req*** server hud
Reply With Quote #1

I need a similar plugin, is a server HUD logo that shows the time, server name, how many players are connected







http://prntscr.com/makwmp
GUCCICSGO is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-22-2019 , 10:24   Re: Req*** server hud
Reply With Quote #2

Edit: was informed about GetClientCount(), check
Quote:
Originally Posted by adma View Post
for a cleaner version =)

Code:
#include <sourcemod>
Handle g_serverHud;
char hostname[64];
int playerCount = 0;

public Plugin myinfo = {
  name = "Server Hud",
  author = "adma",
  description = "",
  version = "1.0",
  url = ""
};

public void OnPluginStart() {
  g_serverHud = CreateHudSynchronizer();
  CreateTimer(1.0, RefreshHudTimer, _, TIMER_REPEAT);
  GetConVarString(FindConVar("hostname"), hostname, sizeof(hostname));
  for (int i = 1; i <= MaxClients; ++i) if (IsClientInGame(i)) playerCount++;
}

public void OnClientPostAdminCheck(int client) {
  ++playerCount;
}

public void OnClientDisconnect(int client) {
  --playerCount;
}

public Action RefreshHudTimer(Handle timer) {
  RefreshHud();
  return Plugin_Continue;
}

void RefreshHud() {
  char hudMessage[128], dateTime[24];
  FormatTime(dateTime, sizeof(dateTime), "%H:%M - %d/%m/%y");
  Format(hudMessage, sizeof(hudMessage), "%s\n%s\nOnline Players: %i/%i", hostname, dateTime, playerCount, MaxClients);
  SetHudTextParams(-1.0, 0.0, 1.0, 255, 255, 255, 255);
  for (int i = 1; i <= MaxClients; ++i) {
    if (!IsClientInGame(i)) continue;
    ShowSyncHudText(i, g_serverHud, hudMessage);
  }
}
Change the numbers coloured red, green and blue to change the colour of the text.
Looks like this (centred across at the top):
Attached Files
File Type: sp Get Plugin or Get Source (serverhud.sp - 212 views - 1.2 KB)

Last edited by adma; 01-22-2019 at 11:35. Reason: tag fail v2
adma is offline
Sajmooooon
Senior Member
Join Date: Nov 2018
Location: Slovakia
Old 01-22-2019 , 10:38   Re: Req*** server hud
Reply With Quote #3

Quote:
Originally Posted by adma View Post
Code:
#include <sourcemod>
Handle g_serverHud;
char hostname[64];
int playerCount = 0;

public Plugin myinfo = {
  name = "Server Hud",
  author = "adma",
  description = "",
  version = "1.0",
  url = ""
};

public void OnPluginStart() {
  g_serverHud = CreateHudSynchronizer();
  CreateTimer(1.0, RefreshHudTimer, _, TIMER_REPEAT);
  GetConVarString(FindConVar("hostname"), hostname, sizeof(hostname));
  for (int i = 1; i <= MaxClients; ++i) if (IsClientInGame(i)) playerCount++;
}

public void OnClientPostAdminCheck(int client) {
  ++playerCount;
}

public void OnClientDisconnect(int client) {
  --playerCount;
}

public Action RefreshHudTimer(Handle timer) {
  RefreshHud();
  return Plugin_Continue;
}

void RefreshHud() {
  char hudMessage[128], dateTime[24];
  FormatTime(dateTime, sizeof(dateTime), "%H:%M - %d/%m/%y");
  Format(hudMessage, sizeof(hudMessage), "%s\n%s\nOnline Players: %i/%i", hostname, dateTime, playerCount, MaxClients);
  SetHudTextParams(-1.0, 0.0, 1.0, 255, 255, 255, 255);
  for (int i = 1; i <= MaxClients; ++i) {
    if (!IsClientInGame(i)) continue;
    ShowSyncHudText(i, g_serverHud, hudMessage);
  }
}
Change the numbers coloured red, green and blue to change the colour of the text.
Looks like this (centred across at the top):
It has bugg
Is it possible to move down like in this plugin https://forums.alliedmods.net/showthread.php?t=309700
and add time left too ?
Sajmooooon is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-22-2019 , 11:15   Re: Req*** server hud
Reply With Quote #4

Attached Files
File Type: sp Get Plugin or Get Source (serverhud.sp - 220 views - 1.2 KB)

Last edited by adma; 01-22-2019 at 11:16.
adma is offline
GUCCICSGO
Junior Member
Join Date: Jan 2019
Location: IASI
Old 01-22-2019 , 12:10   Re: Req*** server hud
Reply With Quote #5

Quote:
Originally Posted by adma View Post
THX but for me , can you delete time left, and add a command !hud for disable / enable hud ++++++++ and add current map & Hp and arrmor

Last edited by GUCCICSGO; 01-22-2019 at 12:20.
GUCCICSGO is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 01-22-2019 , 12:54   Re: Req*** server hud
Reply With Quote #6

Quote:
Originally Posted by GUCCICSGO View Post


THX but for me , can you delete time left, and add a command !hud for disable / enable hud ++++++++ and add current map & Hp and arrmor
why talking in rainbow colors
__________________

Last edited by 8guawong; 01-22-2019 at 12:54.
8guawong is offline
Sajmooooon
Senior Member
Join Date: Nov 2018
Location: Slovakia
Old 01-22-2019 , 15:10   Re: Req*** server hud
Reply With Quote #7

Quote:
Originally Posted by adma View Post
Thank you

Edit: Can u please remove online players from that last one posted, it's bugged, thank you

Last edited by Sajmooooon; 01-22-2019 at 16:24.
Sajmooooon is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-22-2019 , 19:50   Re: Req*** server hud
Reply With Quote #8

Quote:
Originally Posted by Sajmooooon View Post
Thank you

Edit: Can u please remove online players from that last one posted, it's bugged, thank you
What's wrong with it?
adma is offline
Sajmooooon
Senior Member
Join Date: Nov 2018
Location: Slovakia
Old 01-23-2019 , 03:05   Re: Req*** server hud
Reply With Quote #9

Quote:
Originally Posted by adma View Post
What's wrong with it?
It shows 2/64 players, my server has 16 slots and when i use gotv it count it too.

Last edited by Sajmooooon; 01-23-2019 at 03:06.
Sajmooooon is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-23-2019 , 04:11   Re: Req*** server hud
Reply With Quote #10

Quote:
Originally Posted by Sajmooooon View Post
It shows 2/64 players, my server has 16 slots and when i use gotv it count it too.
CS:GO has a max players of 64 all the time, the player count is enforced by match making. Add me here and I'll quickly modify for your needs (i.e. excluding bots)
adma is offline
Reply



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 23:17.


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