I'm looking for some one to port over a Eventscripts plugin called
bananabombs. I'm trying to do a full convert from ES to SM and only a few things are holding me back, this is one of them.
The current ES plugin shows a Banana once it's thrown. What I was hoping for is it actually shows a "bunch of bananas" in your hand and when thrown and the nade explodes it blows up into 4 bananas. No extra damage and no damage from the individual bananas just kinda looks cool. Anyway here is the code from the original plugin written by Wonder and ES Admin. Can anyone help me out and make one for SM even if it's exactly like his?
PHP Code:
block load
{
es_xset bananabombs_ver 1.0
es_xmakepublic bananabombs_ver
es_xset nade 0
es_xset nadenull 0
es_xset nademodel 0
// Make sure we are on a map first or else we'll blow the server up.
isnull nadenull eventscripts_currentmap
ifx false(nadenull) do
{
es_xdoblock bananabombs/precachemodels
}
es_xdoblock corelib/noisy_on
}
block precachemodels
{
es_xprecachemodel nademodel "models/props/cs_italy/bananna.mdl"
}
block unload
{
es_xdoblock corelib/noisy_off
}
event es_map_start
{
es_xdoblock bananabombs/precachemodels
}
event weapon_fire
{
if (grenade in event_var(weapon)) do
{
es_xdelayed 0.1 es_xdoblock bananabombs/dochange
}
else do
{
if (event_var(weapon) equalto flashbang) do
{
es_xdelayed 0.1 es_xdoblock bananabombs/dochange
}
}
}
block dochange
{
// Change the model of the nades.
es_xcreateentitylist nadelist hegrenade_projectile
es_xforeachkey nade in nadelist "es_xdoblock bananabombs/dochange_inner"
es_xkeygroupdelete nadelist
es_xcreateentitylist nadelist flashbang_projectile
es_xforeachkey nade in nadelist "es_xdoblock bananabombs/dochange_inner"
es_xkeygroupdelete nadelist
es_xcreateentitylist nadelist smokegrenade_projectile
es_xforeachkey nade in nadelist "es_xdoblock bananabombs/dochange_inner"
es_xkeygroupdelete nadelist
}
block dochange_inner
{
es_setindexprop server_var(nade) CBaseEntity.m_nModelIndex server_var(nademodel)
es_setindexprop server_var(nade) CBaseEntity.m_clrRender -1
}
event round_start
{
es_xmsg #multi "#green[BananaBombs]#default All grenades have become banana bombs!"
}
__________________