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

Solved [CSGO REQ] Remaining Players Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trickgod
Junior Member
Join Date: Jun 2018
Old 06-17-2018 , 06:29   [CSGO REQ] Remaining Players Plugin
Reply With Quote #1

I created a battle royale server. I Need Remaining Players Plugin.
Maybe CSay or HUD Msg With Colours.
Thank You...

Last edited by trickgod; 06-17-2018 at 09:47.
trickgod is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-17-2018 , 06:38   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #2

Quote:
Originally Posted by trickgod View Post
I created a battle royale server. I Need Remaining Players Plugin.
Maybe CSay or HUD Msg With Colours.
Thank You...
PHP Code:
#include <sdktools>

public void OnGameFrame()
{
    
int iCurrentPlayers GetTeamClientCount(3) + GetTeamClientCount(2);
        
    
PrintHintTextToAll("%i"iCurrentPlayers);

Then you can do stuff like:
HTML Code:
PrintHintTextToAll("<font size="20" color="#00FFF0">%i</font>", iCurrentPlayers);
Google html & sourcepawn, and you'll find some juicy information.

Last edited by mug1wara; 06-17-2018 at 06:45.
mug1wara is offline
trickgod
Junior Member
Join Date: Jun 2018
Old 06-17-2018 , 07:58   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #3

Quote:
Originally Posted by mug1wara View Post
PHP Code:
#include <sdktools>

public void OnGameFrame()
{
    
int iCurrentPlayers GetTeamClientCount(3) + GetTeamClientCount(2);
        
    
PrintHintTextToAll("%i"iCurrentPlayers);

Then you can do stuff like:
HTML Code:
PrintHintTextToAll("<font size="20" color="#00FFF0">%i</font>", iCurrentPlayers);
Google html & sourcepawn, and you'll find some juicy information.
Sorry I Need All Alive Players Count :/
trickgod is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-17-2018 , 08:51   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #4

Code:
public void OnPluginStart()
{
	CreateTimer(1.0, Timer_HudMsg, _, TIMER_REPEAT);
	SetHudTextParams(0.4, 0.2, 1.0, 2, 2, 252, 1, 0);
}

public Action Timer_HudMsg(Handle timer)
{
	static int iAlivePlayers;
	iAlivePlayers = 0;
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i) || !IsPlayerAlive(i))continue;
		iAlivePlayers++;
	}
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i))continue;
		ShowHudText(i, 1, "Remaining players: %d", iAlivePlayers);
	}
}
Enjoy
__________________
Taking private requests

KlausLaw is offline
trickgod
Junior Member
Join Date: Jun 2018
Old 06-17-2018 , 09:08   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #5

Quote:
Originally Posted by KlausLaw View Post
Code:
public void OnPluginStart()
{
	CreateTimer(1.0, Timer_HudMsg, _, TIMER_REPEAT);
	SetHudTextParams(0.4, 0.2, 1.0, 2, 2, 252, 1, 0);
}

public Action Timer_HudMsg(Handle timer)
{
	static int iAlivePlayers;
	iAlivePlayers = 0;
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i) || !IsPlayerAlive(i))continue;
		iAlivePlayers++;
	}
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i))continue;
		ShowHudText(i, 1, "Remaining players: %d", iAlivePlayers);
	}
}
Enjoy
Please Make Hint Text Version ?
trickgod is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-17-2018 , 09:26   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #6

Quote:
Originally Posted by trickgod View Post
Please Make Hint Text Version ?
Code:
public void OnPluginStart()
{
	CreateTimer(1.0, Timer_HudMsg, _, TIMER_REPEAT);
}

public Action Timer_HudMsg(Handle timer)
{
	static int iAlivePlayers;
	iAlivePlayers = 0;
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i) || !IsPlayerAlive(i))continue;
		iAlivePlayers++;
	}
	PrintHintTextToAll("\t<font size='22'><font color='#4169e1'>Remaining players</font>\n\t\t\t<font color='#ff0000'>%d</font></font>", iAlivePlayers);
}
__________________
Taking private requests


Last edited by KlausLaw; 06-17-2018 at 09:37.
KlausLaw is offline
trickgod
Junior Member
Join Date: Jun 2018
Old 06-17-2018 , 09:47   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #7

Quote:
Originally Posted by KlausLaw View Post
Code:
public void OnPluginStart()
{
	CreateTimer(1.0, Timer_HudMsg, _, TIMER_REPEAT);
}

public Action Timer_HudMsg(Handle timer)
{
	static int iAlivePlayers;
	iAlivePlayers = 0;
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i) || !IsPlayerAlive(i))continue;
		iAlivePlayers++;
	}
	PrintHintTextToAll("\t<font size='22'><font color='#4169e1'>Remaining players</font>\n\t\t\t<font color='#ff0000'>%d</font></font>", iAlivePlayers);
}
Perfect Works, Thank Youu !
trickgod is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 06-17-2018 , 11:12   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #8

thanks, I needed that one too
__________________
sHoC is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 06-23-2018 , 10:52   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #9

Quote:
Originally Posted by KlausLaw View Post
Code:
public void OnPluginStart()
{
	CreateTimer(1.0, Timer_HudMsg, _, TIMER_REPEAT);
	SetHudTextParams(0.4, 0.2, 1.0, 2, 2, 252, 1, 0);
}

public Action Timer_HudMsg(Handle timer)
{
	static int iAlivePlayers;
	iAlivePlayers = 0;
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i) || !IsPlayerAlive(i))continue;
		iAlivePlayers++;
	}
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i))continue;
		ShowHudText(i, 1, "Remaining players: %d", iAlivePlayers);
	}
}
Enjoy
can someone edit this one and add kills count? Remaining players: X Kills: 3
ty
__________________
sHoC is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-23-2018 , 11:31   Re: [CSGO REQ] Remaining Players Plugin
Reply With Quote #10

You could just remove the index of the global variable if you want all players kills to be shown.

For hint:
PHP Code:
#include <sourcemod>

int g_iKills[MAXPLAYERS 1];

public 
void OnPluginStart()
{
    
HookEvent("player_death"Event_Death);
    
    
HookEvent("round_end"Event_End);
}

public 
void OnGameFrame()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsPlayerAlive(i))
        {
            
int iCount GetAlivePlayersCount();
            
            
PrintHintTextToAll("<font size = '20'>Remaining players: %s Kills: %s</font>"iCountg_iKills[i]);
        }
    }
}

public 
Action Event_Death(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iAttacker hEvent.GetInt("attacker");
    
    
g_iKills[iAttacker]++;
}

public 
Action Event_End(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    
g_iKills[iClient] = 0;
}

stock int GetAlivePlayersCount()
{
    
int iCount;
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
            
iCount++;
    }
    
    return 
iCount;

For hud:
PHP Code:
#include <sourcemod>

int g_iKills[MAXPLAYERS 1];

public 
void OnPluginStart()
{
    
HookEvent("player_death"Event_Death);
    
    
HookEvent("round_end"Event_End);
}

public 
void OnGameFrame()
{
    
SetHudTextParams(0.50.51.01125510);
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
int iCount GetAlivePlayersCount();
            
            
ShowHudText(i1"Remaining players: %s Kills: %s"iCountg_iKills[i]);
        }
    }
}

public 
Action Event_Death(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iAttacker hEvent.GetInt("attacker");
    
    
g_iKills[iAttacker]++;
}

public 
Action Event_End(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    
g_iKills[iClient] = 0;
}

stock int GetAlivePlayersCount()
{
    
int iCount;
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
            
iCount++;
    }
    
    return 
iCount;


Last edited by mug1wara; 06-23-2018 at 11:33.
mug1wara 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 02:22.


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