AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Biohazard drop weapon (https://forums.alliedmods.net/showthread.php?t=153881)

Racoon 03-30-2011 15:03

Biohazard drop weapon
 
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)
        }
    }




All times are GMT -4. The time now is 14:37.

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