Raised This Month: $ Target: $400
 0% 

Biohazard drop weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Racoon
Senior Member
Join Date: Mar 2008
Location: Ukraine
Old 03-30-2011 , 15:03   Biohazard drop weapon
Reply With Quote #1

A had an interesting idea. What if humans could drop weapons when they got infected. This idea is for Biohazard. I've already tried to use this code:
http://forums.alliedmods.net/showpos...50&postcount=6
But it doesn't work.
PHP Code:
public cmd_infectuser(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED_MAIN
    
    
static arg1[32]
    
read_argv(1arg131)
    
    static 
target
    target 
cmd_target(idarg1, (CMDTARGET_OBEY_IMMUNITY|CMDTARGET_ALLOW_SELF|CMDTARGET_ONLY_ALIVE))
    
    if(!
is_user_connected(target) || g_zombie[target])
        return 
PLUGIN_HANDLED_MAIN
    
    
if(!allow_infection())
    {
        
console_print(id"%L"id"CMD_MAXZOMBIES")
        return 
PLUGIN_HANDLED_MAIN
    
}
    
    if(!
g_gamestarted)
    {
        
console_print(id"%L"id"CMD_GAMENOTSTARTED")
        return 
PLUGIN_HANDLED_MAIN
    
}
            
    static 
name[32
    
get_user_name(targetname31)
    
DropPlayerWeapons(target0)
    
console_print(id"%L"id"CMD_INFECTED"name)
    
infect_user(target0)
    
    return 
PLUGIN_HANDLED_MAIN
}

public 
DropPlayerWeaponsid )
{    
    new 
iWeapons[32], iNumiWeapon
    get_user_weapons
(idiWeaponsiNum)
    new 
szWeaponName[22]
    for(--
iNumiNum>=0iNum--)
    {
        
iWeapon iWeapons[iNum]
        if( 
iWeapons & (1<<iWeapon) && ~NODROP_WPNS_BITSUM & (1<<iWeapon) )
        {
            
get_weaponname(iWeaponszWeaponNamecharsmax(szWeaponName))
            
engclient_cmd(id"drop"szWeaponName)
        }
    }

Racoon is offline
Send a message via ICQ to Racoon
Reply


Thread Tools
Display Modes

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 14:37.


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