Junior Member
Join Date: Sep 2018
Location: Venezuela
|
05-16-2019
, 13:53
Re: Plugin team score for capture the flag
|
#2
|
Quote:
Originally Posted by jievylook
Hi all,
Someone knows of a plugin that indicates the score of the teams, it is for a server of captures the flag.
Example:
Blue Team 01 - Red Team 03
I also need a plugin that shows the accumulated adrenaline in the screm
Thank you.
|
PHP Code:
#include <amxmodx>
#include <jctf>
#include <cstrike>
#include <dhudmessage>
#define PLUGIN "Team Score (JCTF)"
#define VERSION "1.46"
#define AUTHOR "Sugisaki"
new scorett
new scorect
new Conteo
new Tonteo
new SND_BLUE_WIN[] = "ctf/blue_wins.wav"
new SND_RED_WIN[] = "ctf/red_wins.wav"
new SND_TEAMS_TIED[] = "ctf/teams_tied.wav"
enum
{
TEAM_NONE = 0,
TEAM_RED,
TEAM_BLUE,
TEAM_SPEC
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TextMsg","game_c","a","2&#Game_C")
set_task(0.7,"score_round",_,_,_,"b")
set_task(0.1, "check", _, _, _, "b")
set_task(0.1,"conteo_team",19708,_,_,"b")
scorett = 0
scorect = 0
}
public PlaySound(sound[])
{
client_cmd(0, "spk ^"%s^"", sound)
}
public plugin_precache()
{
precache_sound(SND_BLUE_WIN)
precache_sound(SND_RED_WIN)
precache_sound(SND_TEAMS_TIED)
}
public game_c()
{
set_task(3.0, "reset_score")
}
public reset_score()
{
scorett = 0
scorect = 0
}
public jctf_flag(ev, id, tm)
{
if(ev == FLAG_CAPTURED)
{
switch(tm)
{
case TEAM_RED: scorect++
case TEAM_BLUE: scorett++
}
}
return
}
public score_round()
{
set_dhudmessage(255, 255, 255, 0.34, 0.03, 0, 6.0, 12.0)
show_dhudmessage(0, "[%d] Blue Team || Red Team [%d]^n %i %i", Conteo, Tonteo, scorect, scorett)
}
public check()
{
new string[10]
get_cvar_string("amx_timeleft", string, 10)
if(equal(string, "00:00"))
{
remove_task(_)
if(scorect == scorett)
PlaySound(SND_TEAMS_TIED)
else if(scorect>scorett)
PlaySound(SND_BLUE_WIN)
else if(scorect<scorett)
PlaySound(SND_RED_WIN)
}
}
public conteo_team() {
new iCTconteo
for(new i = 0; i <= get_maxplayers(); i++) {
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
{
iCTconteo++
}
}
new iTRconteo
for(new i = 0; i <= get_maxplayers(); i++)
{
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
{
iTRconteo++
}
}
Conteo = iCTconteo
Tonteo = iTRconteo
}
__________________
|
|