Mam problem z klasami które mają wybuch w sobie. Występuje masa błędów a po nich następuje crash serwera. Przed reinstallem tego nie miałem a teraz nie wiem jakie pliki podmienić.
Oto błędy:
L 07/05/2011 - 16:55:37: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/05/2011 - 16:55:37: [AMXX] Run time error 4: index out of bounds L 07/05/2011 - 16:55:37: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/05/2011 - 16:55:37: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/05/2011 - 16:55:37: [AMXX] Run time error 4: index out of bounds L 07/05/2011 - 16:55:37: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/05/2011 - 16:55:37: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/05/2011 - 16:55:37: [AMXX] Run time error 4: index out of bounds L 07/05/2011 - 16:55:37: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/05/2011 - 16:55:37: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/05/2011 - 16:55:37: [AMXX] Run time error 4: index out of bounds L 07/05/2011 - 16:55:37: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56)
Zauważcie że to wszystko jest w jednej sekundzie.
A oto kod klasy:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <colorchat>
#include <engine>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "[Elite] General+";
new const opis[] = "Klasa premium, wybucha po smierci zadajac 60(+intelgencja) obrazen. Ma 1/2 z HE.";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_HEGRENADE | 1<<CSW_FLASHBANG | 1<<CSW_SMOKEGRENADE | 1<<CSW_DEAGLE;
new const zdrowie = 30;
new const kondycja = 20;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new sprite_blast, sprite_white;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_advance(cod_get_classid("[Pro] General+"), 80, nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc,"Premium");
register_event("DeathMsg", "Death", "ade");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public plugin_precache()
{
sprite_white = precache_model("sprites/white.spr") ;
sprite_blast = precache_model("sprites/dexplo.spr");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_F))
{
ColorChat(id, RED, "[General+] Nie masz uprawnien, aby korzystac z tej klasy.");
return COD_STOP;
}
ColorChat(id, GREEN, "Klasa stworzona przez pluginymody.webd.pl");
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public Death()
{
new victim = read_data(2);
if(ma_klase[victim])
Eksploduj(victim);
}
public Eksploduj(id)
{
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( id, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
write_byte( TE_BEAMCYLINDER );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] );
write_coord( iOrigin[2] );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] + 300 );
write_coord( iOrigin[2] + 300 );
write_short( sprite_white );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 100 );// r, g, b
write_byte( 100 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 8 ); // speed
message_end();
new entlist[33];
new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid))
continue;
cod_inflict_damage(id, pid, 60.0, 0.4);
}
return PLUGIN_CONTINUE;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if((weapon == CSW_HEGRENADE) && !random(2))
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}Dodam też że takich klas mam kilka i w linni 56 zamiast id zamieniłem w kolejnych klasach na victim i ofiara.
Prosiłbym o jakieś wskazówki w jaki sposób moża naprawić ten problem.
Pozdrawiam.
Dodano 05 lipiec 2011 - 18:03:
Edit.
Podmieniłem moduły na serwerze i błędów brak. Moduły wgrałem z amx'a 1.8.2
Dodano 08 lipiec 2011 - 11:40:
A jednak. Serwer był czysty przez kilka dni. Od wczoraj sypie errorami jak głupi.
Oto logi:
L 07/08/2011 - 12:22:47: [AMXX] Displaying debug trace (plugin "srn.amxx") L 07/08/2011 - 12:22:47: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:22:47: [AMXX] [0] srn.sma::client_authorized (line 1305) L 07/08/2011 - 12:23:37: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/08/2011 - 12:23:37: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:23:37: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/08/2011 - 12:23:37: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/08/2011 - 12:23:37: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:23:37: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/08/2011 - 12:25:31: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/08/2011 - 12:25:31: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:25:31: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/08/2011 - 12:25:31: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/08/2011 - 12:25:31: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:25:31: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/08/2011 - 12:25:31: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/08/2011 - 12:25:31: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:25:31: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56) L 07/08/2011 - 12:25:31: [AMXX] Displaying debug trace (plugin "codclass_elitegeneral+.amxx") L 07/08/2011 - 12:25:31: [AMXX] Run time error 4: index out of bounds L 07/08/2011 - 12:25:31: [AMXX] [0] codclass_elitegeneral+.sma::Death (line 56)
Są jeszcze te:
L 07/08/2011 - 12:01:47: [ENGINE] Invalid entity 141 L 07/08/2011 - 12:01:47: [AMXX] Displaying debug trace (plugin "codclass_promedyk+.amxx") L 07/08/2011 - 12:01:47: [AMXX] Run time error 10: native error (native "entity_get_edict") L 07/08/2011 - 12:01:47: [AMXX] [0] codclass_promedyk+.sma::MedkitThink (line 91) L 07/08/2011 - 12:01:47: [ENGINE] Invalid entity 141 L 07/08/2011 - 12:01:47: [AMXX] Displaying debug trace (plugin "codclass_elitemedyk+.amxx") L 07/08/2011 - 12:01:47: [AMXX] Run time error 10: native error (native "entity_get_edict") L 07/08/2011 - 12:01:47: [AMXX] [0] codclass_elitemedyk+.sma::MedkitThink (line 92) L 07/08/2011 - 12:01:47: [ENGINE] Invalid entity 141 L 07/08/2011 - 12:01:47: [AMXX] Displaying debug trace (plugin "codclass_mastermedyk+.amxx") L 07/08/2011 - 12:01:47: [AMXX] Run time error 10: native error (native "entity_get_edict") L 07/08/2011 - 12:01:47: [AMXX] [0] codclass_mastermedyk+.sma::MedkitThink (line 96)
Oraz te:
L 07/08/2011 - 07:51:16: [AMXX] Run time error 8 (plugin "QTM_CodMod1.amxx") - debug not enabled! L 07/08/2011 - 07:51:16: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 07/08/2011 - 07:51:17: [AMXX] Run time error 7 (plugin "QTM_CodMod1.amxx") - debug not enabled! L 07/08/2011 - 07:51:17: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 07/08/2011 - 07:52:29: [AMXX] Run time error 7 (plugin "QTM_CodMod1.amxx") - debug not enabled! L 07/08/2011 - 07:52:29: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 07/08/2011 - 07:53:14: [AMXX] Run time error 7 (plugin "QTM_CodMod1.amxx") - debug not enabled! L 07/08/2011 - 07:53:14: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 07/08/2011 - 07:53:43: [AMXX] Run time error 7 (plugin "QTM_CodMod1.amxx") - debug not enabled! L 07/08/2011 - 07:53:43: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 07/08/2011 - 07:54:33: [AMXX] Run time error 7 (plugin "QTM_CodMod1.amxx") - debug not enabled! L 07/08/2011 - 07:54:33: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 07/08/2011 - 07:55:05: [AMXX] Run time error 7 (plugin "QTM_CodMod1.amxx") - debug not enabled!
Tutaj przy debugu pokazuje Stack low.
Prosiłbym o jakieś podpowiedzi w jaki sposób można to naprawić. Dodam że prędzej miałem starszą wersję cod'a. Ściągnąłem najnowszą i podmieniłem kilka publiców.


Dodatki SourceMod



Temat jest zamknięty









