AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Displays the wrong value of the clip ammo (https://forums.alliedmods.net/showthread.php?t=336343)

Xpym4uk76 02-13-2022 05:26

Displays the wrong value of the clip ammo
 
1 Attachment(s)
I have a problem with zp weapon. When I drop it on the floor and get it up again, sometimes it shows 0 bullets in clip ammo, sometimes shows correct. I dont know how to fix it, i tried to fix it, tried to set manualy the clip ammo on giving and geting weapon, its doesnt helps. Please help me fix that problem :)

Its only visual bug!

Uzviseni Bog 02-13-2022 17:54

Re: Displays the wrong value of the clip ammo
 
Add a Plugin that forbids throwing weapons

Xpym4uk76 02-14-2022 15:52

Re: Displays the wrong value of the clip ammo
 
Quote:

Originally Posted by Uzvseni Bog (Post 2771421)
Add a Plugin that forbids throwing weapons

GENIUS! :down::nono:

AdrenalinesWrath 02-14-2022 18:50

Re: Displays the wrong value of the clip ammo
 
well, maybe remove the return plugin_supercede which is found here:

Code:

public fw_Item_Deploy_Post(weapon_ent)
{
        new owner = pev(weapon_ent,pev_owner)
        if(is_user_alive(owner) && get_user_weapon(owner) == CSW_BASE && g_has_M32[owner])
                Set_Player_Zoom(owner, 0)
       
        static weaponid; weaponid = cs_get_weapon_id(weapon_ent)
        if(is_user_alive(owner)) replace_weapon_models(owner, weaponid)
       
        new id = get_pdata_cbase(weapon_ent, 41, 4)
        if (!g_has_M32[id] || !is_user_alive(id)) return HAM_IGNORED
    static Ent; Ent = fm_get_user_weapon_entity(id, CSW_BASE)
    static iClip; iClip = get_pdata_int(Ent, 51, 4)
    new ammo, clip, weapon = get_user_weapon(id, clip, ammo)
        server_print("CLIP %d AMMO %d", iClip, ammo)
        return HAM_SUPERCEDE
}

actually:

Code:

public fw_Item_Deploy_Post(weapon_ent)
{
        static owner;owner = pev(weapon_ent,pev_owner)
        static weaponid; weaponid = cs_get_weapon_id(weapon_ent)
        if(is_user_alive(owner){
                if(get_user_weapon(owner) == CSW_BASE && g_has_M32[owner]) {
                        Set_Player_Zoom(owner, 0)
                }
                replace_weapon_models(owner, weaponid)
        }
}



All times are GMT -4. The time now is 11:35.

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