Using entity id is totally unreliable, because if another entity is spawned it could break the code(since index will be changed). Also using multiple files is more organized, so don't change.
PHP Code:
new g_szDirectory[512], g_szFilename[512]
Way too much, 256 would be just enough.
PHP Code:
new iEnt = find_ent_by_model(-1, szClass, szModel)
Create iEnt var before looping.
PHP Code:
fclose(iFilePointer)
should be inside
if(iFilePointer) check.
Since
pev_mins and
pev_maxs give you float values use EngFunc_WriteCoord instead of converting float to int.
__________________