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

Solved Message to appear only after first round not after warmup


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Razvann.
Senior Member
Join Date: Jul 2012
Old 01-24-2021 , 15:21   Message to appear only after first round not after warmup
Reply With Quote #1

Hello! How can I edit this plugin to show both messages from him to appear only after first round played not after warmup?

Code:
#include <sourcemod>
#include <cstrike>
#include <zephstocks>

#pragma semicolon 1

#define PLUGIN_VERSION "1.0.1"

public Plugin:myinfo = 
{
	name = "alliedmods",
	author = "alliedmods",
	description = "alliedmods",
	version = PLUGIN_VERSION,
	url = "http://www.alliedmods.net"
};

public OnPluginStart()
{
	IdentifyGame();

	// Supress warnings about unused variables.....
	if(g_bL4D || g_bL4D2 || g_bND) {}

	CreateConVar("sm_showleader_csgo_version", PLUGIN_VERSION, "Plugin version", FCVAR_CHEAT|FCVAR_DONTRECORD|FCVAR_NOTIFY|0|FCVAR_SPONLY);
	HookEvent("round_start", OnRoundStart);
}

public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	CreateTimer(3.0, LeaderAnnounceTimer);
}

public Action:LeaderAnnounceTimer(Handle:timer, any:data)
{
	new String:m_szMessage[256];

	new Leader = FindLeader();
	if(Leader == 0)
		return Plugin_Handled;
	new Frags = GetClientFrags(Leader);
	new Deaths = GetClientDeaths(Leader);

	if(g_bCSGO)
	{
		new Assists = CS_GetClientAssists(Leader);
		new Score = CS_GetClientContributionScore(Leader);
		Format(STRING(m_szMessage), "• {teamcolor}%N [Scor: %d] {default}este cel mai mare {green}alcoolist {default}cu {lightred}%d/%d/%i", Leader, Score, Frags, Assists, Deaths);
	}
	else
	{
		Format(STRING(m_szMessage), "• {teamcolor}%N [Scor: %d] {default}este cel mai mare {green}alcoolist {default}cu {lightred}%d/%i", Leader, Frags, Frags, Deaths);
	}

	ReplaceColors(STRING(m_szMessage), Leader);
	PrintToChatAll(m_szMessage);
	
	return Plugin_Handled;
}

FindLeader()
{
	new Leader = 0;
	new Score = -1;
	for(new i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i) && ((g_bCSGO && CS_GetClientContributionScore(i) > Score) || (!g_bCSGO && GetClientFrags(i) > Score)))
		{
			if(g_bCSGO)
				Score = CS_GetClientContributionScore(i);
			else
				Score = GetClientFrags(i);
			Leader = i;
		}
	}
	return Leader;
}
Thanks!

Last edited by Razvann.; 01-30-2021 at 20:55.
Razvann. is offline
Send a message via Yahoo to Razvann.
 



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 12:21.


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