wiec taki kod mam skompilowac aby sie w ostatniej rundzie wyswietlala informacja: To jest ostatnia runda. ?
bo nie widze tutaj linii z wyswietleniem tekstu
ps. moze nie zrozumiales, ale ja mam ustawione okreslona liczbe rund, a nie wygranych rund przez jedna z druzyn.
#include <amxmodx>
#include <amxmisc>
new g_teamScore[2]
public plugin_init()
{
register_plugin("end-round counter", "1.0", "drcopy")
register_ ("checkroundsleft")
register_ ("teamScore")
return PLUGIN_CONTINUE
}
public teamScore(id) {
new team[2]
read_data(1,team,1)
g_teamScore[(team[0]=='C')? 0 : 1] = read_data(2)
return PLUGIN_CONTINUE
}
public checkroundsleft()
{
new maxRounds = get_cvar_num("mp_maxrounds")
new roundsleft = maxRounds - (g_teamScore[0] + g_teamScore[1])
if (roundsleft == 1) { server_cmd("exec server.cfg")
}
return PLUGIN_CONTINUE
}
@EDIT:
znalazlem taki plugin:
#include <amxmodx>
new
g_sHostname[128], g_iHostname, g_iMaxrounds,
g_iCnt_round, g_iPos;
public plugin_init()
{
register_plugin( "Round Hostname", "1.0", "Arkshine" );
register_event( "HLTV", "eNew_round", "a", "1=0", "2=0" );
register_event( "TextMsg" , "eRestart_attempt", "a", "2=#Game_will_restart_in" );
}
public plugin_cfg()
{
g_iHostname = get_cvar_pointer( "hostname" );
g_iMaxrounds = get_cvar_pointer( "mp_maxrounds" );
}
public eRestart_attempt()
g_iCnt_round = 0;
public eNew_round()
{
++g_iCnt_round;
get_pcvar_string( g_iHostname, g_sHostname, charsmax( g_sHostname ) );
g_iPos = contain( g_sHostname, "|" );
if( g_iPos > 0 )
g_sHostname[ g_iPos - 1 ] = '^0';
static sNew_hostname[128];
formatex( sNew_hostname, charsmax( sNew_hostname ), "%s | Runda %i/%i", g_sHostname, g_iCnt_round, get_pcvar_num( g_iMaxrounds ) );
set_pcvar_string( g_iHostname, sNew_hostname );
}
public plugin_end()
{
g_sHostname[ g_iPos - 1 ] = '^0';
set_pcvar_string( g_iHostname, g_sHostname );
}
wyswietla on w nazwie serwera:
Runda [1/20]
moglby ktos to przerobic zeby to pisalo w say'u na poczatku rundy na kolorowo?