AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How check player bullet are her shoot it? (https://forums.alliedmods.net/showthread.php?t=233075)

spag 01-09-2014 13:33

How check player bullet are her shoot it?
 
How check player bullet are her shoot it?

I need start any task, when player have 1 bullet and remove task, when he shoot it, but i don't know how, please help..

Code:

public Ham_DeagleFire_Post(iEnt)
{
    if (g_iCurrentGame != LR_S4S)
    {
        return;
    }
 
    new id = pev(iEnt, pev_owner);
    new iOpponentEnt;
 
    if (cs_get_weapon_ammo(iEnt) == 0)
    {
        if (id == g_iLastRequest[LR_PRISONER])
        {
            iOpponentEnt = fm_find_ent_by_owner(-1, "weapon_deagle", g_iLastRequest[LR_GUARD]);
         
            if (pev_valid(iOpponentEnt))
            {
                cs_set_weapon_ammo(iOpponentEnt, 1);
            }
        }
     
        else if (id == g_iLastRequest[LR_GUARD])
        {
            iOpponentEnt = fm_find_ent_by_owner(-1, "weapon_deagle", g_iLastRequest[LR_PRISONER]);
         
            if (pev_valid(iOpponentEnt))
            {
                cs_set_weapon_ammo(iOpponentEnt, 1);
            }
        }
    }
}



All times are GMT -4. The time now is 10:08.

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