Raised This Month: $18 Target: $400
 4% 

Solved Weapons Skins For vip menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 03-29-2017 , 09:54   Weapons Skins For vip menu
Reply With Quote #1

Hey guys!
I want to make menu with this shape:-
MoNSteR Ak47
CooL M4a1
Deagle
___________
but in this plugin i want to change normal skin. mean when i have defult ak47 and when i choose MoNSteR AK47. The skin change to the new one .

Last edited by ahmedkhater012; 03-29-2017 at 13:18.
ahmedkhater012 is offline
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 03-29-2017 , 12:52   Re: Weapons Skins For vip menu
Reply With Quote #2

test.

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

#define PLUGIN "Weapons Model Vip"
#define VERSION "1.0"
#define AUTHOR "SirErick"

new g_weapons[33], g_one_round[33], g_maxplayers

new const WEAPONENTNAMES[][] = { """weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10""weapon_aug""weapon_smokegrenade"
    
"weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550""weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552""weapon_ak47""weapon_knife""weapon_p90" }

enum _:model_weapons
{
    
V_AK47,
    
V_M4A1,
    
V_DEAGLE
}
enum _:models_weapons_new 
{
    
V_WEAPONS[50]
}
new const 
new_weapons[model_weapons][models_weapons_new] = 
{
     
    
"models/you_model_ak47.mdl"
    
"models/you_model_m4a1.mdl"
    
"models/you_model_deagle.mdl"


public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
set_pcvar_string(register_cvar("Weapons Model Vip"VERSIONFCVAR_SERVER|FCVAR_SPONLY), VERSION)
    for (new 
1sizeof WEAPONENTNAMESi++)
    {
        if(
WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
    }
    
register_clcmd("say /weapons""new_menu")
    
g_maxplayers get_maxplayers()
}
public 
plugin_precache()
{
    for(new 
0;sizeof new_weapons;i++) 
    {
             
        
precache_model(new_weapons[i][V_WEAPONS]);
    }
}
public 
client_putinserver(id)
{
    
g_weapons[id] = 0
    g_one_round
[id] = true
}
public 
event_round_start()
{
    for (new 
id 1id <= g_maxplayersid++)
    {
        if (!
is_user_connected(id))
            continue;
                
        
g_one_round[id] = true
    
}
}    
public 
new_menu(id
{
    if (!
is_user_alive(id) || !g_one_round[id])
        return 
PLUGIN_HANDLED 

    
new Menu menu_create("\yNice Weapons""show_menu_weapons")
    
menu_additem(Menu"\wMoNSteR Ak47"            "1"0)
    
menu_additem(Menu"\wCooL M4a1 "            "2"0)
    
menu_additem(Menu"\wDeagle"            "3"0)

    
menu_setprop(Menu,MPROP_EXITNAME,"Exit")
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL

    
menu_display(idMenu0)
    return 
PLUGIN_HANDLED 

public 
show_menu_weapons(idmenuitem
{
    if (!
is_user_alive(id) || !g_one_round[id])
        return 
PLUGIN_HANDLED 

    
if(item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    switch(
item)
    {
        case 
0:
        {
            
            
g_weapons[id] = 1
        
}
        case 
1:
        {
            
            
g_weapons[id] = 2
        
}
        case 
2:
        {
            
            
g_weapons[id] = 3
        
}
    }
    
g_one_round[id] = false
    
return PLUGIN_HANDLED;
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    if(!
pev_valid(weapon_ent))
    return

    
// Get weapon's owner
    
static owner
    owner 
fm_cs_get_weapon_ent_owner(weapon_ent)

    
// Get weapon's id
    
static weaponid
    weaponid 
cs_get_weapon_id(weapon_ent)

    switch (
weaponid)
    {
        
        case 
CSW_AK47
        {
            
            if (
g_weapons[owner] == 1)
            {
                
                
set_pev(ownerpev_viewmodel2new_weapons[V_AK47][V_WEAPONS])
            }
        }
        case 
CSW_M4A1
        {
            
            if (
g_weapons[owner] == 2)
            {
                
                
set_pev(ownerpev_viewmodel2new_weapons[V_M4A1][V_WEAPONS])
            }
        }
        case 
CSW_DEAGLE
        {
            
            if (
g_weapons[owner] == 2)
            {
                
                
set_pev(ownerpev_viewmodel2new_weapons[V_DEAGLE][V_WEAPONS])
            }
        }
    }
}    
stock fm_cs_get_weapon_ent_owner(ent
{
    
// Prevent server crash if entity's private data not initalized
    
if (pev_valid(ent) != 2)
    return -
1;

    return 
get_pdata_cbase(ent414);

__________________
√ Zombie plague + greats updates. finished.
√ Surf-Mod level + greats updates Finished.
√ Zombie Scenario like cso. Finished.
Click Here
√ Call Of Duty MOD. Finished.
Click Here


Sorry for my bad english. I'm using translate.

Last edited by sirerick; 03-31-2017 at 08:06.
sirerick is offline
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 03-29-2017 , 13:21   Re: Weapons Skins For vip menu
Reply With Quote #3

yas17sin.. Helped me thx for him
ahmedkhater012 is offline
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 03-30-2017 , 22:15   Re: Weapons Skins For vip menu
Reply With Quote #4

Thx you sirerick...Your plugin worked
ahmedkhater012 is offline
ahmedkhater012
Member
Join Date: Jan 2017
Location: Egypt
Old 03-30-2017 , 23:43   Re: Weapons Skins For vip menu
Reply With Quote #5

Can you make it open for only one round
(sirerick)

Last edited by ahmedkhater012; 03-30-2017 at 23:44.
ahmedkhater012 is offline
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 03-31-2017 , 08:06   Re: Weapons Skins For vip menu
Reply With Quote #6

Quote:
Originally Posted by ahmedkhater012 View Post
Can you make it open for only one round
(sirerick)
i edit. test again
__________________
√ Zombie plague + greats updates. finished.
√ Surf-Mod level + greats updates Finished.
√ Zombie Scenario like cso. Finished.
Click Here
√ Call Of Duty MOD. Finished.
Click Here


Sorry for my bad english. I'm using translate.
sirerick 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 19:59.


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