PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <dhudmessage>
#define PLUGIN "Team Score"
#define VERSION "1.0"
#define AUTHOR "Unknown"
#define TASK_GETPLAYER 37852
new g_SyncTeamCount
new ct_score, terrorist_score;
new rounds_elapsed
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("TeamScore", "team_score", "a")
state OutOfRound
g_SyncTeamCount = CreateHudSyncObj()
register_logevent("LogEvent_Round_Start", 2, "1=Round_Start")
register_logevent("Logevent_Round_End", 2, "1=Round_End")
RegisterHam(Ham_Spawn, "player", "client_disconnect", true)
RegisterHam(Ham_Killed, "player", "client_disconnect", true)
set_task(1.0,"score_round",_,_,_,"b")
}
public team_score()
{
new team[32];
read_data(1,team,31);
if (equal(team,"CT"))
{
ct_score = read_data(2);
}
else if (equal(team,"TERRORIST"))
{
terrorist_score = read_data(2);
}
}
public score_round()
{
set_dhudmessage(0, 70, 200, -1.0, 0.0, 0, 0.5, 2.0, 0.08, 2.0, true);
show_dhudmessage(0,"-=-COUNTER[%d] ", ct_score);
set_dhudmessage(200, 0, 0, -1.0, 0.0, 0, 0.5, 2.0, 0.08, 2.0, true);
show_dhudmessage(0," [%d]TERRORIST-=-", terrorist_score);
}
The scoreboard supposed to look like this COUNTER[%d]=[Round %d]=[%d]TERRORIST
[%d]=========[VS]=========[%d]