Quote:
Originally Posted by OciXCrom
There is no "id" in that function.
|
that's how it works! but how do I add another explosion sprite here and what would it work for players without ADMIN_KICK
Code:
#include <amxmodx>
#define NEW_SPRITE "sprites/eexplo9.spr"
#define ADMIN_ACCESS ADMIN_KICK
new g_sModelIndexExp;
new g_sModelIndexExp2;
new g_sModelIndexFireball2;
new g_sModelIndexFireball3;
public plugin_init()
{
register_plugin("[CS] HE grenade Sprite", "1.0", "Doc.Batcon");
register_message(SVC_TEMPENTITY, "MsgHook_SVC_TEMPENTITY");
}
public plugin_precache()
{
g_sModelIndexFireball2 = precache_model("sprites/eexplo.spr");
g_sModelIndexFireball3 = precache_model("sprites/fexplo.spr");
g_sModelIndexExp = precache_model(NEW_SPRITE);
}
public MsgHook_SVC_TEMPENTITY(iMsgID, iMsgDest, pClient)
{
if (iMsgDest != MSG_PAS)
return;
if (get_msg_arg_int(1) != TE_EXPLOSION)
return;
static sNewModelIndex; sNewModelIndex = -1;
static sModelIndex; sModelIndex = get_msg_arg_int(5);
new players[32], inum
get_players(players, inum)
for(new i = 0; i < inum; ++i)
{
if(get_user_flags(players[i]) & ADMIN_ACCESS)
{
if (sModelIndex == g_sModelIndexFireball2)
sNewModelIndex = g_sModelIndexExp
else if (sModelIndex == g_sModelIndexFireball3)
sNewModelIndex = g_sModelIndexExp2
// CSSDK | HE Grenade framerate = 30
if (get_msg_arg_int(7) != 30)
return;
if (sNewModelIndex != -1)
set_msg_arg_int(5, ARG_SHORT, sNewModelIndex)
}
}
}