Raised This Month: $32 Target: $400
 8% 

VIP Purchase Gold Gun Skins (Quick Paid Job?)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blood2k
Senior Member
Join Date: Mar 2014
Old 07-02-2019 , 18:19   VIP Purchase Gold Gun Skins (Quick Paid Job?)
Reply With Quote #1

Hey guys, I've seen different types of these existing here and they do the job but not how I'd like it. Could somebody make it so when ADMIN_LEVEL_H players buy AK47 or M4a1
it will give them custom gold colored model automatically instead, and if they die with this weapon the weapon that gets dropped can not be picked up by other non ADMIN_LEVEL_H players? With a message showing "You're not a VIP, you can not use gold weapons".

Thank you! I know this is simple, and I've found plugins on here that get the job done by replacing the skin with the proper precached skin etc... but I'm looking for the ability to restrict the pickup of these weapons for normal non admin_level_h users. I have all V,P, and W models so no worries. I can add every gun as needed if somebody wants to atleast make it work for the AK47 and M4a1.

P.S I can paypal you some quick cash if you can get it done?

Last edited by blood2k; 07-02-2019 at 18:19.
blood2k is offline
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
Reply


Thread Tools
Display Modes

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 17:39.


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