AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_CS_Weapon_SendWeaponAnim Possible Bug? (https://forums.alliedmods.net/showthread.php?t=332203)

Shadows Adi 04-29-2021 09:18

Ham_CS_Weapon_SendWeaponAnim Possible Bug?
 
Hello,
I am registering the Ham_CS_Weapon_SendWeaponAnim as a post function, when I am retrieving the player's index using get_pdata_cbase and sending the animation only for spectators, when a player is spectating a CT Player, it is refreshing the animation once to 10 seconds ~, spectating a Terrorist player, seems to working as intended ( refreshing every second ).

Here is the registered function:
PHP Code:

RegisterHam(Ham_CS_Weapon_SendWeaponAnim"weapon_usp""Ham_CS_Weapon_SendWeaponAnim_Post"1); 

And here is the function:
PHP Code:

public Ham_CS_Weapon_SendWeaponAnim_Post(iEntiAnimSkiplocal)
{
    if(
pev_valid(iEnt) != 2)
        return 
HAM_IGNORED;

    new 
iPlayerweapon;
    
// OFFSET_WEAPONOWNER 41
    // XO_WEAPON 4
    
iPlayer get_pdata_cbase(iEntOFFSET_WEAPONOWNERXO_WEAPON);

    if(!
is_user_alive(iPlayer))    return HAM_IGNORED;
    
    
client_print(get_user_index("Adi"), print_chat"iPlayer: %d"iPlayer)
    
client_print(get_user_index("Adi"), print_chat"mWFCiKpHoelOqyWXDkqQcdWKTigEmGl's index: %d"get_user_index("mWFCiKpHoelOqyWXDkqQcdWKTigEmGl"))
    
    return 
HAM_IGNORED;


Screenshot: http://prntscr.com/1296hlq ( Player mWFCiKpHoelOqyWXDkqQcdWKTigEmGl is CT and player with index 6 is Terrorist )

Shadows Adi 05-05-2021 08:14

Re: Ham_CS_Weapon_SendWeaponAnim Possible Bug?
 
Up, could it be from harden pev validation?


All times are GMT -4. The time now is 02:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.