hi guys, how do I make sure that the player's lighting is always on? and the now only seconds 2 in the early round of only
Code:
/*
This is a remake of deadbeats leaderglow plugin.
====================================================
Plugin to cause the Lead Player (top score) on each Team to glow at the end of each round, i.e. after the round has ended, but before the next round starts.
If a player says "glow" it will respond with a short message explaining that the lead player on each team glows at the end of each round.
There must be at least 3 (THREE) players on the server before the glowing kicks in - doesn't make much sense otherwise icon_deep_clin.gif
Just a bit of fun really, but it's kinda nice to see who the top guy/gal is on each team at the end of the round. Shamelessly influenced by Ravenous Bug Blatter Beast's glow plugin for AdminMOD.
====================================================
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
new g_Version[] = "0.1";
/* Keep Track of Player ID for Lead Player on each Team */
new g_Lead_CT = -1
new g_Lead_T = -1
/*
*********************************************************
* Find the lead player for each team and make them glow *
*********************************************************
*/
GlowLeaders() {
/* Skip the glowing if there's only two people playing */
new i_numplayers = get_playersnum(0); /* get number of alive players */
if (i_numplayers < 2) return
i_numplayers = get_playersnum(1); /* get total number of players, including ones connecting */
/* Figure out who the Lead Player is for each team */
new i_Lead_CT_frags = -100
new i_Lead_T_frags = -100
new i_Lead_CT_deaths = -100
new i_Lead_T_deaths = -100
new s_team[3]
new i_frags
new i_deaths
g_Lead_CT = -1
g_Lead_T = -1
for (new i_player = 0; i_player < i_numplayers; i_player++) {
i_frags = get_user_frags(i_player)
i_deaths = get_user_deaths(i_player)
get_user_team(i_player, s_team, 3)
/* is player Lead CT? */
if (equali(s_team,"CT",2))
if ((i_frags > i_Lead_CT_frags) ||
((i_frags == i_Lead_CT_frags) && (i_deaths < i_Lead_CT_deaths))) {
i_Lead_CT_frags = i_frags
i_Lead_CT_deaths = i_deaths
g_Lead_CT = i_player
}
/* is player Lead Terrorist? */
if (equali(s_team,"TE",2))
if ((i_frags > i_Lead_T_frags) ||
((i_frags == i_Lead_T_frags) && (i_deaths < i_Lead_T_deaths))) {
i_Lead_T_frags = i_frags
i_Lead_T_deaths = i_deaths
g_Lead_T = i_player
}
}
/* Make the Lead Player Glow for each team */
if (g_Lead_CT != -1) set_user_rendering(g_Lead_CT, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 15)
if (g_Lead_T != -1) set_user_rendering(g_Lead_T, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 15)
}
/*
*********************************************************
* Turn off glowing for the lead players on each team *
*********************************************************
*/
UnGlowLeaders() {
if (g_Lead_CT != -1) set_user_rendering(g_Lead_CT, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
if (g_Lead_T != -1) set_user_rendering(g_Lead_T, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
}
/*
*********************************************************
* Stop Glowing at RoundStart *
*********************************************************
*/
public roundStart()
{
UnGlowLeaders()
}
/*
*********************************************************
* Start Glowing at RoundEnd *
*********************************************************
*/
public roundEnd()
{
GlowLeaders()
}
/*
*********************************************************
* Report Glowing
*********************************************************
*/
public reportGlow(id)
{
new s_message[] = "Lead Players Glow at RoundEnd to RoundStart"
set_hudmessage(0,255,0, 0.05, 0.50, 2, 0.1, 3.0, 0.02, 0.02, 10)
show_hudmessage(id, s_message)
client_print(id, print_chat, s_message)
return PLUGIN_HANDLED
}
/*
*********************************************************
* Initialise the Plugin *
*********************************************************
*/
public plugin_init()
{
register_plugin("LeaderGlow Plugin(deadBeat", g_Version, "Man... or Astro-Man?");
register_logevent("roundStart", 2, "1=Round_Start")
register_logevent("roundEnd", 2, "1=Round_End")
register_clcmd("say glow", "reportGlow")
register_clcmd("say_team glow", "reportGlow")
return PLUGIN_CONTINUE;
}