AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set Rendering on Dropped Weapons (https://forums.alliedmods.net/showthread.php?t=135162)

GXLZPGX 08-13-2010 08:55

Set Rendering on Dropped Weapons
 
Alright, so I hooked the drop command, and this is what I came up with:

PHP Code:

public cmdDrop(id)
{
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    new 
iDropped get_user_weapon(id)
    
    if( 
iDropped == CSW_DEAGLE && gInLR[id] == true && gToss == true )
    {
        if( 
cs_get_user_team(id) == CS_TEAM_T )
        {
            
set_renderingiDroppedkRenderFxGlowShell25500kRenderNormal255 )
        }
        
        if( 
cs_get_user_team(id) == CS_TEAM_CT )
        {
            
set_renderingiDroppedkRenderFxGlowShell00255kRenderNormal255 )
        }
    }
    
    return 
PLUGIN_CONTINUE;


Doesn't seem to glow anything.

DarkGod 08-13-2010 09:38

Re: Set Rendering on Dropped Weapons
 
You need to get the entity index of the weapon, this is not the same as what get_user_weapon() returns which is the CSW_* value. There's quite a few ways to get the entity index which you can find by using search.

ConnorMcLeod 08-13-2010 11:36

Re: Set Rendering on Dropped Weapons
 
Also you need to render the weaponbox, not the weapon, and it's not created yet at drop cmd.


All times are GMT -4. The time now is 21:50.

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