Code:
#include <amxmodx>
#pragma semicolon 1
#pragma ctrlchar '\'
new SCORE_BLUE;
new g_TeamScore[2];
new currentScore;
public show_timer()
{
new prevScore;
new nextmap[32];
get_cvar_string("amx_nextmap", nextmap, 31);
new timeleft = get_timeleft();
if(timeleft == 0)
{
prevScore = currentScore;
currentScore = 0;
}
set_hudmessage(255, 255, 255, 0.00, 0.00, 0, 1.00, 1000.00, 0.10, 0.20, 13);
show_hudmessage(0, "WELCOME TO THE OUTHOUSE\nTimeleft: %d:%02d\nCurrent Score: %d\nPrevious Score: %d", timeleft / 60, timeleft % 60, currentScore, prevScore);
return 0;
}
public get_teamscore()
{
new team[32];
read_data(1,team,31);
if(!strcmp(team,"Blue"))
currentScore = read_data(2);
return PLUGIN_CONTINUE;
}
public logevent_round_end()
{
client_print(0, print_chat, "end of game");
}
public plugin_init()
{
register_event("TeamScore","get_teamscore","a");
register_logevent("logevent_round_end", 2, "1=Round_End");
//register_logevent("capcounter", 3, "1=triggered", "2&dropoff");
register_plugin("TimeProjector", "0.1", "ST4life");
set_task(1.00, "show_timer", 0, "", 0, "b", 0);
return 0;
}
would like to get the score from a previous game to carry over to another.. hopefully without writing and reading from files.. Tried that earlier and I was getting an invalid expression