Hi, this plugins makes one cycle at start of every round - makes, drops and hides the bomb after drop. I want to ask the way its made is ot good ?
Code:
#include <amxmodx>
#include <fakemeta>
public plugin_init()
{
register_plugin( "Round End", "1.0", "hleV/Exolent/<VeCo>" )
register_logevent( "LogeventSpawnWithBomb", 3, "2=Spawned_With_The_Bomb" )
register_forward( FM_SetModel, "SetModel" )
}
//Code by hleV(CREATE BOMB)
public plugin_precache()
{
new iEntity = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "func_bomb_target" ) )
set_pev( iEntity, pev_solid, SOLID_NOT )
}
//Code by Exolent(DROPPED BOMB)
public LogeventSpawnWithBomb( iEntity )
{
engclient_cmd( 0, "drop", "weapon_c4" )
}
//this code by <VeCo>(DELETE BOMB AFTER THROW)
public SetModel( iEntity, const szModel[] )
{
if( !pev_valid( iEntity ) ) return
static szClassName[ 10 ]
pev( iEntity, pev_classname, szClassName, 9 )
if( !equal( szClassName, "weaponbox" ) || szModel[ 9 ] != 'b' ) return
engfunc( EngFunc_SetOrigin, iEntity, Float:{ 0.0, 0.0, 0.0 } )
}