Raised This Month: $7 Target: $400
 1% 

add extra items to VIP gun menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mosi
Junior Member
Join Date: Feb 2018
Old 02-15-2018 , 14:14   add extra items to VIP gun menu
Reply With Quote #1

Hi. I create a simple VIP gun menu and I add some extra items with plugin to my Server and I wanna add these extra items to my VIP Gun menu

my menu handle :

PHP Code:
public giveWeapon(idkey)
{
    
    
    
strip_user_weapons(id);
    
//key will start at zero
    
switch(key){
        case 
0:
        {
            
give_weapon_x(id"weapon_ak47")
            
give_special_pack(id)
        }
        case 
1:
        {
            
give_weapon_x(id"weapon_m4a1")
            
give_special_pack(id)
        }
        case 
2:
        {
            
give_weapon_x(id"weapon_awp")
            
give_special_pack(id)
        }
        case 
3:
        {
            
give_weapon_x(id"weapon_famas")
            
give_special_pack(id)
        }
        case 
4:
        {
            
give_weapon_x(id"weapon_galil")
            
give_special_pack(id)
        }
        case 
5:
        {
            
give_railcannon(id)
            
give_special_pack(id)
        }
    }
    
    return 
PLUGIN_HANDLED

my extra gun :

PHP Code:

public plugin_init()
{
    
register_plugin("Rail Cannon""1.0""m4m3ts")
    
register_cvar("rail_version""m4m3ts"FCVAR_SERVER|FCVAR_SPONLY)
    
register_event("CurWeapon","CurrentWeapon","be","1=1")
    
register_think(SMOKE_CLASS"fw_Fire_smoke")
    
RegisterHam(Ham_Item_AddToPlayer"weapon_m3""fw_RAILCANNON_AddToPlayer")
    
RegisterHam(Ham_Use"func_tank""fw_UseStationary_Post"1)
    
RegisterHam(Ham_Use"func_tankmortar""fw_UseStationary_Post"1)
    
RegisterHam(Ham_Use"func_tankrocket""fw_UseStationary_Post"1)
    
RegisterHam(Ham_Use"func_tanklaser""fw_UseStationary_Post"1)
    
    for (new 
1sizeof WEAPONENTNAMESi++)
        if (
WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m3""fw_RAIL_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m3""fw_RAIL_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Weapon_Reload"weapon_m3""RAILCANNON_Reload")
    
RegisterHam(Ham_Weapon_Reload"weapon_m3""RAILCANNON_Reload_Post"1)
    
RegisterHam(Ham_Weapon_WeaponIdle"weapon_m3""fw_railcannonidleanim"1)
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
    
register_forward(FM_CmdStart"fw_CmdStart")
    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
register_forward(FM_TraceLine,"fw_traceline",1)
    
    
gmsgWeaponList get_user_msgid("WeaponList")
    
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack")
    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_breakable""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_wall""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_door""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_door_rotating""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_plat""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_rotating""fw_TraceAttack"1)
    
    
register_clcmd("get_railcannon""give_railcannon"ADMIN_KICK)
    
g_MaxPlayers get_maxplayers()
}

public 
give_railcannon(id)
{
    
drop_weapons(id1)
    new 
iWep2 give_item(id,"weapon_m3")
    if( 
iWep2 )
    {
        
cs_set_weapon_ammo(iWep2cvar_clip_railcannon)
        
cs_set_user_bpammo (idCSW_M3cvar_railcannon_ammo)
        
UTIL_PlayWeaponAnimation(idRAILCANNON_DRAW)
        
set_weapons_timeidle(idCSW_M31.0)
        
set_player_nextattackx(id1.0)
        
g_clip_ammo[id] = cs_get_weapon_ammo(iWep2)
    }
    
g_has_railcannon[id] = true
    g_SpecialAmmo
[id] = 0
    udah
[id] = 0
    zz
[id] = 0
    railcannon_mode
[id] = 1
    update_specialammo
(idg_SpecialAmmo[id], g_SpecialAmmo[id] > 0)
    
message_begin(MSG_ONEgmsgWeaponList, {0,0,0}, id)
    
write_string("weapon_railcannon")
    
write_byte(5)
    
write_byte(32)
    
write_byte(-1)
    
write_byte(-1)
    
write_byte(0)
    
write_byte(5)
    
write_byte(21)
    
write_byte(0)
    
message_end()

I do not want user can't access "railcannon" gun with type get_railcannon in the console ! I buy it with VIP gun menu

Thanks For help and Sorry for my bad english ! ♥
mosi 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 00:04.


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