Raised This Month: $ Target: $400
 0% 

VIP Purchase Gold Gun Skins (Quick Paid Job?)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
JusTGo
Veteran Member
Join Date: Mar 2013
Old 07-03-2019 , 15:04   Re: VIP Purchase Gold Gun Skins (Quick Paid Job?)
Reply With Quote #2

this is for ak47 you need to edit the path of the models to match yours
Untested :

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define SKIN_ACCESS ADMIN_LEVEL_H

new const m_rgpPlayerItems_CWeaponBox] = { 34 35 , ... };
new const 
XO_CWEAPONBOX 4;

new 
g_iMaxPlayers
#define IsPlayer(%0)    ( 1 <= (%0) <= g_iMaxPlayers )

#define V_MODEL "models/v_ak_gold.mdl"
#define P_MODEL "models/p_ak_gold.mdl"
#define W_MODEL "models/w_ak_gold.mdl"

public plugin_precache()
{
    
precache_model(V_MODEL)
    
precache_model(P_MODEL)
    
precache_model(W_MODEL)
}
 
public 
plugin_init()
{
    
register_plugin"Skins""0.0.1""JustGo" )
 
    
RegisterHam(Ham_Touch"weaponbox""OnCWeaponBox_Touch")
    
RegisterHam(Ham_Item_Deploy"weapon_ak47""fw_Item_Deploy_Post"1)    

    
register_forward(FM_SetModel"fw_SetModel")
 
    
g_iMaxPlayers get_maxplayers()
}
 
public 
OnCWeaponBox_Touchweaponbox id )
{
    if( !
pev_valid(weaponbox) ) return HAM_IGNORED
    
if( IsPlayer(id) && is_user_alive(id) && pev(weaponboxpev_flags) & FL_ONGROUND )
    {
        new 
weapon get_pdata_cbase(weaponboxm_rgpPlayerItems_CWeaponBox[5], XO_CWEAPONBOX)
        if( !
weapon ) return HAM_IGNORED

        
if (get_user_flags(id) & SKIN_ACCESS) return HAM_IGNORED

        
static WpnModel[64]
        
pev(weaponboxpev_modelWpnModelcharsmax(WpnModel))

        if( 
equal(WpnModelW_MODEL ))
            return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED
}  

public 
fw_Item_Deploy_Post(Ent)
{
    if(
pev_valid(Ent) != 2)
        return

    static 
idid get_pdata_cbase(Ent414)

    if(
get_pdata_cbase(id373) != Ent)
        return

    if(!(
get_user_flags(id) & SKIN_ACCESS))
        return
    
    
set_pev(idpev_viewmodel2V_MODEL)
    
set_pev(idpev_weaponmodel2P_MODEL)
}

public 
fw_SetModel(entitymodel[])
{
    if(!
pev_valid(entity)) 
        return 
FMRES_IGNORED

    
new className[33]
    
pev(entitypev_classnameclassNamecharsmax(className))

    if(!
equal(className"weaponbox"))
        return 
FMRES_IGNORED

    
static iOwner
    iOwner 
pev(entitypev_owner)

    if (!(
get_user_flags(iOwner) & SKIN_ACCESS)) return FMRES_IGNORED
    
    
if(equal(model"models/w_ak47.mdl")) 
    {
        
engfunc(EngFunc_SetModelentityW_MODEL)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________
JusTGo is offline
 



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 10:04.


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