Raised This Month: $ Target: $400
 0% 

Help regarding "CurWeapon"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-27-2015 , 05:56   Help regarding "CurWeapon"
Reply With Quote #1

Biohazard mode have this function:
PHP Code:
register_event("CurWeapon""event_curweapon""be""1=1"
PHP Code:
public event_curweapon(id)
{
    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE
    
    
static weapon
    weapon 
read_data(2)

    static 
ammotype
    ammotype 
get_pcvar_num(cvar_ammo)
    
    if(!
ammotype || (AMMOWP_NULL & (1<<weapon)))
        return 
PLUGIN_CONTINUE

    
static maxammo
    
switch(ammotype)
    {
        case 
1maxammo g_weapon_ammo[weapon][MAX_AMMO]
        case 
2maxammo g_weapon_ammo[weapon][MAX_CLIP]
    }

    if(!
maxammo)
        return 
PLUGIN_CONTINUE
    
    
switch(ammotype)
    {
        case 
1:
        {
            static 
ammo
            ammo 
cs_get_user_bpammo(idweapon)
            
            if(
ammo 1
                
cs_set_user_bpammo(idweaponmaxammo)
        }
        case 
2:
        {
            static 
clipclip read_data(3)
            if(
clip 1)
            {
                static 
weaponname[32]
                
get_weaponname(weaponweaponname31)
                
                static 
ent 
                ent 
find_ent_by_owner(-1weaponnameid)
                
                
cs_set_weapon_ammo(entmaxammo)
            }
        }
    }    
    return 
PLUGIN_CONTINUE

The purpose of this is to adjust whether the players have unlimited ammo,or unlimited clip.
My question is:Could this be implemented without the use of Curweapon?
Krtola is offline
Send a message via Skype™ to Krtola
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:13.


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