PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Destroy Weapons"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_SetModel, "SetModel")
}
public SetModel(iEnt, szModel[])
{
if( equal(szModel, "models/w_", 9) )
{
new szClassName[2]
pev(iEnt, pev_classname, szClassName, charsmax(szClassName))
if( szClassName[0] == 'w' ) // "weaponbox" against "grenade"
{
set_pev(iEnt, pev_nextthink, get_gametime() + 10.0)
}
}
}
Hello all! This plugin removes dropped weapon after 10 second. Is possible to add an effect to this process?
For example,
PHP Code:
g_Explode = precache_model("sprites/white.spr");
// how to get origin of dropped weapon?
// new Float:Origin[3]
// get.. weapon.. origin..
create_explode(Origin[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_EXPLOSION2);
write_coord(vec1[0]);
write_coord(vec1[1]);
write_coord(vec1[2]);
write_byte(185);
write_byte(10);
message_end();
}
__________________