I'm trying to show holster animation but the animation Doesn't play
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Weapon"
#define VERSION "1.0"
#define AUTHOR "Gian Yagami"
new weapon [][] =
{
"weapon_357",
"weapon_9mmAR",
"weapon_9mmhandgun",
"weapom_crossbow",
"weapon_crowbar",
"weapon_egon",
"weapon_gauss",
"weapon_handgrenade",
"weapon_hornetgun",
"weapon_rpg",
"weapon_satchel",
"weapon_shotgun",
"weapon_snark",
"weapon_tripmine"
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
for(new i = 0; i < sizeof weapon; i++)
{
RegisterHam(Ham_Item_Holster, weapon[i], "holster")
}
}
public holster(ent)
{
//message_begin(MSG_ONE, SVC_WEAPONANIM, _, ent)
//write_byte(8) //Animation id
//write_byte(pev(ent,pev_body))
//message_end()
//new playerid = get_pdata_cbase(ent, 41, 4)
new id = pev(ent, pev_owner)
set_pev(id, pev_weaponanim, 8)
}
Using
message_begin and
get_pdata_cbase will make game crash.