Witam,
posiadam problem, który powoduje Crash z powodem "Segmentation fault (core dumped)".
Błąd pojawia się w momencie wgrania podobnego do poniższego kodu, pluginu, a serwer crashuje w losowym momencie.
Plugin jest zrobiony pod serwer JailBreak. Czy podana poniżej metoda jest poprawna?
// ENT
new ent;
// ENT
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_touch("ent_id","player","dotyk_ent");
register_event("HLTV", "Nowa_Runda", "a", "1=0", "2=0");
register_logevent("Koniec_Rundy", 2, "1=Round_End")
}
public Koniec_Rundy()
{
if(is_valid_ent(ent))
{
remove_entity(ent);
}
}
public dotyk_ent(ent_id, id)
{
if(is_valid_ent(ent_id))
{
remove_entity(ent_id);
}
return PLUGIN_CONTINUE;
}
public stworz_ent(Float:pozycje[3])
{
ent = engfunc(EngFunc_CreateNamedEntity , engfunc(EngFunc_AllocString,"info_target"));
if(!pev_valid(ent))
{
return;
}
set_pev(ent, pev_classname, "ent_id" );
set_pev(ent, pev_model, "MODEL");
engfunc(EngFunc_SetSize,ent, Float:{ -1.0, -1.0, -1.0}, Float:{ 2.5, 2.5, 2.5 });
engfunc(EngFunc_SetOrigin,ent, pozycje );
set_pev(ent, pev_solid, SOLID_BBOX);
set_pev(ent, pev_movetype, MOVETYPE_TOSS);
}
public Nowa_Runda()
{
new Float:pozycje[3];
// przypisane kordy
stworz_ent(pozycje)
}


Dodatki SourceMod



Temat jest zamknięty










