Raised This Month: $ Target: $400
 0% 

Set Rendering on Dropped Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-13-2010 , 08:55   Set Rendering on Dropped Weapons
Reply With Quote #1

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.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 08-13-2010 , 09:38   Re: Set Rendering on Dropped Weapons
Reply With Quote #2

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.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-13-2010 , 11:36   Re: Set Rendering on Dropped Weapons
Reply With Quote #3

Also you need to render the weaponbox, not the weapon, and it's not created yet at drop cmd.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 21:50.


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