I don't see an obvious reason for the crash. Xalus code will still only find one lasermine and destroy it.
If you want to edit it to find more you need to remove "ent = -99;" and "break". But you also have to find another condition to display the message. I strongly suggest a counter. And if counter is not equal to 0, display the message.
To find what part of the code crashes the server, add log_amx between each line to see exactly where it stops. Like this for example:
Code:
log_amx("Starting the loop");
while((ent = find_ent_in_sphere(id,origin,512.0)) != 0)
{
log_amx("Looping entity %d", ent);
pev(ent, pev_classname, EntityName, 31)
if(equali(EntityName, ENT_CLASS_NAME))
{
log_amx("Classname match on entity %d", ent);
if(pev(ent, LASERMINE_OWNER) == id)
{
log_amx("Owner match on entity %d: %d", ent, id);
PlaySound(ent, STOP_SOUND)
log_amx("PlaySound completed");
CreateExplosion(ent)
log_amx("CreateExplosion completed");
CreateDamage(ent, get_pcvar_float(g_LRDMG), get_pcvar_float(g_LRADIUS))
log_amx("CreateDamage completed");
RemoveEntity(ent)
log_amx("RemoveEntity completed");
ColorChat(id, RED, "^4[SkazzY LaserMine] ^1You have succesfully ^3DETONATED ^1your lasermine")
log_amx("ColorChat completed");
ent = -99;
break
}
}
}
log_amx("Loop completed");
And as a side note, almost all code is instant. There is only one thread in AMXX and HLDS for that matter. Otherwise you would not be able to manipulate hooks and stop them if necessary.
As far as plugin coding goes, as long as you're inside a function in your code, nothing else will run until that function is finished.
The exception is if a module creates another thread. But this can only be done with certain things, like sockets or heavy calculations that does not require any input to finish.
__________________