Raised This Month: $ Target: $400
 0% 

Custom Weapon Drop & Pickup


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-05-2013 , 19:42   Re: Custom Weapon Drop & Pickup
Reply With Quote #1

Quote:
Originally Posted by Blizzard_87 View Post
thats all for only ONE custom weapon?.

cos i want to turn all guns into gold when they purchase the upgrade for that gun.
Did you not try my suggestion?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-06-2013 , 05:36   Re: Custom Weapon Drop & Pickup
Reply With Quote #2

Here is other way, i think even better.

PHP Code:
#define max_weapons 3
new const wp_models[max_weapons][32] =
{
    
"w_m4a1.mdl",
    
"w_ak47.mdl",
    
"w_awp.mdl",
}

new const 
wp_newmodels[max_weapons][32] =
{
    
"models/w_m4a1_gold.mdl",
    
"models/w_ak47_gold.mdl",
    
"models/w_awp_gold.mdl",
}

public 
pfn_spawn(ent)
{
    static 
abm[32], cr0
    pev
entpev_modelm31 )
    for(
0max_weaponsa++ )
    {
        
0
        
for(732b++ )
        {
            if( !
wp_models[max_weapons][c] )
            {
                
a
                
break
            }
            if( 
m[b] == wp_models[max_weapons][c] ) c++
            else break
        }
        if( 
) break
    }
    
set_peventpev_modelswp_newmodels[r] )
    
set_peventpev_team255 )
}

// since, i dont know the w_models classname, i have to use this 
public pfn_touch(ident)
{
    static 
r
    pev
entpev_team)
    if( 
255 ) return
    
-= 255
    
switch(r)
    {
        case 
0give_golden_m4a1()
        case 
1give_golden_ak47()
        case 
2give_golden_awp()
    }


Last edited by .Dare Devil.; 06-06-2013 at 05:37.
.Dare Devil. 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 16:27.


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