Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
I tried to play custom player model sequence that are not in default cs1.6 player model (more than 111 sequences). I found a player model on the internet that has many custom sequences. But I have no idea why walk, run, crouch, jump not play on the new player model? Did i miss something? The new anim extention is working but the movement seq is static. See the code for more details.
You need a custom player model too. Click
Here is my code:
You need a custom player model too. Click
Here is my code:
PHP:
#include <amxmodx>
#include <hamsandwich>
#include <reapi>
#define MODEL_P "models/p_thanatos9a.mdl"
#define MODEL_V "models/v_thanatos9.mdl"
#define MODEL_PLAYER "heroine_ex"
#define WEAPON_REFERENCE "weapon_knife"
#define ANIM_EXTENTION "skullaxe"
/*enum _:SKULLAXE_SEQS
{
CROUCH_AIM=184,
CROUCH_SHOOT,
REF_AIM,
REF_SHOOT
}*/
public plugin_precache()
{
precache_model(MODEL_P)
precache_model(MODEL_V)
new szText[64]
formatex(szText, charsmax(szText), "models/player/%s/%s.mdl", MODEL_PLAYER, MODEL_PLAYER)
precache_model(szText)
}
public plugin_init()
{
register_plugin("Custom Player Anims", __DATE__, "metal_upa")
RegisterHam(Ham_Item_Deploy, WEAPON_REFERENCE, "OnItemDeploy", 1)
RegisterHam(Ham_Weapon_PrimaryAttack, WEAPON_REFERENCE, "OnItemPrimaryAttack", 1)
RegisterHookChain(RG_CBasePlayer_Spawn, "OnPlayerSpawn", 1)
RegisterHookChain(RG_CBasePlayer_SetAnimation, "OnPlayerSetAnimation", 0)
RegisterHookChain(RG_CBaseAnimating_ResetSequenceInfo, "OnResetSequenceInfo", 0)
}
public OnPlayerSpawn(const id)
{
if(!is_user_alive(id))
{
return;
}
rg_set_user_model(id, MODEL_PLAYER, true)
new ent = rg_give_item(id, "weapon_elite", GT_DROP_AND_REPLACE)
if(ent != -1)
{
new iMaxClip=50, iMaxAmmo1=32767
rg_set_iteminfo(ent, ItemInfo_iMaxClip, iMaxClip)
rg_set_iteminfo(ent, ItemInfo_iMaxAmmo1, iMaxAmmo1)
set_member(ent, m_Weapon_iClip, iMaxClip)
rg_set_user_bpammo(id, WEAPON_ELITE, iMaxAmmo1)
}
}
public OnItemDeploy(ent)
{
if(!is_entity(ent))
{
return;
}
new id = get_member(ent, m_pPlayer)
if(!is_entity(id))
{
return;
}
set_entvar(id, var_viewmodel, MODEL_V)
set_entvar(id, var_weaponmodel, MODEL_P)
set_member(id, m_szAnimExtention, ANIM_EXTENTION)
}
public OnItemPrimaryAttack(ent)
{
if(!is_entity(ent))
{
return HAM_IGNORED;
}
new id = get_member(ent, m_pPlayer)
if(!is_entity(id))
{
return HAM_IGNORED;
}
/*static iFlags, szAnimation[64], iAnimDesired;
iFlags = get_entvar(id, var_flags);
formatex(szAnimation, charsmax(szAnimation), iFlags & FL_DUCKING ? "crouch_shoot_%s" : "ref_shoot_%s", ANIM_EXTENTION);
iAnimDesired = lookup_sequence(id, szAnimation)
client_print(id, print_chat, "Seq:%d", iAnimDesired)
if (iAnimDesired == -1)
{
iAnimDesired = 0;
}
set_entvar(id, var_sequence, iAnimDesired)*/
return HAM_IGNORED;
}
public OnPlayerSetAnimation(const id, PLAYER_ANIM:anim)
{
//client_print(id, print_chat, "OnPlayerSetAnimation(%d, %d)", id, anim)
}
public OnResetSequenceInfo(const id)
{
//client_print(0, print_chat, "OnResetSequenceInfo(%d)", id)
}
Вложения
-
3.6 MB Просмотры: 2