Witam. Plugi zaczął wywalać jakieś error logi, patrzcie niżej:
L 10/26/2015 - 06:08:19: [AMXX] Displaying debug trace (plugin "best_player.amxx") L 10/26/2015 - 06:08:19: [AMXX] Run time error 4: index out of bounds L 10/26/2015 - 06:08:19: [AMXX] [0] colorchat.inc::ColorChat (line 75) L 10/26/2015 - 06:08:19: [AMXX] [1] best_player_3056689.sma::pokaz_staty (line 50)
Jeśli ktoś mógłby to naprawić leci +
.sma:
#include <amxmodx>
#include <colorchat>
#define PLUGIN "Best player"
#define VERSION "0.5a"
#define AUTHOR "Sebul"
new RoundNumber, cvar_round, cvar_frags_multi, g_MaxPlayers, MapName[32];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("SendAudio", "pokaz_staty", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin");
register_event("TextMsg", "round_begin", "a", "2&#Game_C", "2&#Game_will_restart_in");
cvar_frags_multi = register_cvar("amx_frags_multi", "1.5");
cvar_round = register_cvar("amx_number_round", "5");
g_MaxPlayers = get_maxplayers();
get_mapname(MapName, 31);
}
public round_begin() RoundNumber = 0;
public pokaz_staty() {
new ile_rund = get_pcvar_num(cvar_round);
if(++RoundNumber > ile_rund) {
RoundNumber = ile_rund;
new Float:fragi = -20.0, Float:bilans, Float:zabojstwa;
new Float:mnoznik = get_pcvar_float(cvar_frags_multi);
new index, i;
for(i=1; i<=g_MaxPlayers; ++i) {
if(!is_user_connected(i) || is_user_bot(i) || is_user_hltv(i)) continue;
zabojstwa = get_user_frags(i)*mnoznik;
bilans = zabojstwa-get_user_deaths(i);
if(zabojstwa > 0 && fragi < bilans) {
fragi = bilans;
index = i;
}
}
if(is_user_connected(index)) {
new name[48], user_team;
get_user_name(index, name, 47);
user_team = get_user_team(index);
ColorChat(0, user_team == 1 ? RED : user_team == 2 ? BLUE : GREY, "^4[%s]^3 %s^1 prowadzi w grze z^3 %i^1 fragami i^3 %i^1 zgonami", MapName, name, get_user_frags(index), get_user_deaths(index));
}
else ColorChat(0, GREY, "^4[%s]^1 Brak prowadzacego w grze", MapName);
}
}


Dodatki SourceMod











