I am a beginner on coding plugins, so i hope someone can help me.
I make a little plugin that destroy some "func_breakable" ents on FM_spawn.
Here is the code that destroy the ents on FM_spawn:
PHP Code:
register_forward(FM_Spawn, "fwd_Spawn")
public fwd_Spawn(ent) {
///if(enable == false)
// return FMRES_IGNORED
if(!pev_valid(ent))
return FMRES_IGNORED
static ClassName[32], i, size
pev(ent, pev_classname, ClassName, 31)
size = sizeof(g_RemovedEntities)
for(i=0; i < size; i++)
{
if(equali(ClassName, g_RemovedEntities[i]))
{
//check for bomb explosion entity like boxes and dont remove them
if(pev(ent, pev_spawnflags) != 1)
{
entity_set_float(ent, EV_FL_takedamage, 0.0)
//engfunc(EngFunc_RemoveEntity, ent);
return FMRES_SUPERCEDE
}
}
}
return FMRES_IGNORED
}
The code works for me, but how can i get working it on roundstart? roundstart never give me an "ent" like FM_spawn. Can someone help me pls to make it possible?
I know that i can remove the ents on FM_spawn and there will never come back, but thats not that what i want. I need to remove ents only for some rounds.
Greetz,
ScHrAnZ DiNgEnS
PS: Sorry for my bad english, i hope you can understand me =)