[ReQ] Instead of VIP Features.

Unpaid Requests, Public Plugins
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#11

Post by Spir0x » 6 years ago

[mention]Raheem[/mention] Please just fix this weapon appear when i chose another vip must have normal weapon and this m249.
and simply edit give just 1 fire nade 1 frost nade ! i need it bro

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#12

Post by Raheem » 6 years ago

What this means? "this weapon appear when i chose another vip"

For giving 1 fire, frost:
  • Code: Select all

    #include <ze_vip>
    
    // Models
    new g_v_szMinigunModel[64] = "models/v_m249_vip.mdl"
    new g_p_szMinigunModel[64] = "models/p_m249_vip.mdl"
    new g_w_szMinigunModel[64] = "models/w_m249_vip.mdl"
    
    // Cvars
    new g_pCvarDamage
    
    // Variables
    new bool:g_bHaveMiniGun[33]
     
    public plugin_init()
    {
        register_plugin("VIP Features", "1.1", "Raheem")
    	
    	// Cvars
    	g_pCvarDamage = register_cvar("ze_minigun_damage", "1.5")
    	
    	// HookChains
    	RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Post", 1)
    	
    	// Hams
    	RegisterHam(Ham_Item_Deploy, "weapon_m249", "Fw_ItemDeploy_Post", 1)
    	
    	// Forwards
    	register_forward(FM_SetModel, "Fw_SetModel_Post", 1)
    }
    
    public plugin_precache() 
    {
    	// Models
    	precache_model(g_v_szMinigunModel)
    	precache_model(g_p_szMinigunModel)
    	precache_model(g_w_szMinigunModel)
    }
    
    public client_disconnected(id)
    {
    	if (g_bHaveMiniGun[id])
    	{
    		g_bHaveMiniGun[id] = false
    	}
    }
    
    public ze_user_infected(infected)
    {
    	if (g_bHaveMiniGun[infected])
    	{
    		g_bHaveMiniGun[infected] = false
    	}
    }
     
    public ze_user_humanized(id)
    {
        // Not VIP? Exit the function...
    	if (!(ze_get_vip_flags(id) & VIP_A))
    		return
    	
    	// Give M249
    	g_bHaveMiniGun[id] = true
    	rg_give_item(id, "weapon_m249", GT_APPEND)
    	rg_set_user_bpammo(id, WeaponIdType:get_weaponid("weapon_m249"), 200)
       
        // Give x1 Fire Nades
        rg_give_item(id, "weapon_hegrenade", GT_APPEND)
        //rg_set_user_bpammo(id, WeaponIdType:get_weaponid("weapon_hegrenade"), rg_get_user_bpammo(id, WeaponIdType:get_weaponid("weapon_hegrenade")) + 1)
       
        // Give x1 Frost Nades
        rg_give_item(id, "weapon_flashbang", GT_APPEND)
        //rg_set_user_bpammo(id, WeaponIdType:get_weaponid("weapon_flashbang"), rg_get_user_bpammo(id, WeaponIdType:get_weaponid("weapon_flashbang")) + 1)
    }
    
    public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
    {
    	if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
    		return HC_CONTINUE
    	
    	if (g_bHaveMiniGun[iAttacker] && (get_user_weapon(iAttacker) == CSW_M249))
    	{
    		SetHookChainArg(4 , ATYPE_FLOAT, fDamage * get_pcvar_float(g_pCvarDamage))
    		return HC_CONTINUE
    	}
    	return HC_CONTINUE
    }
    
    public Fw_ItemDeploy_Post(iEnt)
    {
    	new id = get_member(iEnt, m_pPlayer)
    	
    	if (g_bHaveMiniGun[id])
    	{
    		set_pev(id, pev_viewmodel2, g_v_szMinigunModel)
    		set_pev(id, pev_weaponmodel2, g_p_szMinigunModel)
    	}
    }
    
    public Fw_SetModel_Post(iEnt, szModel[])
    {
    	if(!pev_valid(iEnt))
    		return FMRES_IGNORED
    
    	if(!equali(szModel, "models/w_m249.mdl"))
    		return FMRES_IGNORED
    
    	new iOwner = get_member(iEnt, m_pPlayer)
    
    	// If Player Has G3SG1
    	if(g_bHaveMiniGun[iOwner] && pev_valid(iEnt))
    	{
    		// Set weaponbox new model
    		engfunc(EngFunc_SetModel, iEnt, g_w_szMinigunModel)
    		return FMRES_SUPERCEDE
    	}
    	return FMRES_IGNORED
    }
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#13

Post by Spir0x » 6 years ago

lol my mistake i try to say when round starts i have a m249 and when i take another weapon from weapons list the m249 appears!

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#14

Post by Raheem » 6 years ago

You mean M249 disappear when you choose a weapon from menu?
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#15

Post by Spir0x » 6 years ago

Yes but now i can't see the weapons menu :) lol becuz i changed my old ze_weapon_menu to your ze_weapon_menu from the pack your send me and look at server's log

L 11/30/2017 - 23:41:27: [AMXX] Displaying debug trace (plugin "ze_weapon_menu.amxx", version "1.1")
L 11/30/2017 - 23:41:27: [AMXX] Run time error 10: native error (native "ArrayGetString")
L 11/30/2017 - 23:41:27: [AMXX] [0] ze_weapon_menu.sma::Show_Menu_Buy_Primary (line 379)
L 11/30/2017 - 23:41:27: [AMXX] [1] ze_weapon_menu.sma::Show_Available_Buy_Menus (line 302)
L 11/30/2017 - 23:41:27: [AMXX] [2] ze_weapon_menu.sma::ze_user_humanized (line 277)

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#16

Post by Spir0x » 6 years ago

so ?

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#17

Post by Spir0x » 6 years ago

Please update it like i told you raheem.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#18

Post by Raheem » 6 years ago

This will need me to make native to use it to give player the weapon when he buy the primary weapon. Or the ze_weapons_menu plugin you will use give me and i'll edit it for you.
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#19

Post by Spir0x » 6 years ago

i dont have ze_weapon_menu becuz i'm using your server pack i didn't find source codes on it

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#20

Post by Spir0x » 6 years ago

[mention]TheWhitesmith[/mention] can you help raheem to make this plugin perfect ?

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#21

Post by Raheem » 6 years ago

The weapons menu source i use is same as posted in GamePlay section. Just find this line: rg_give_item(id, szWeaponName, GT_REPLACE) replace it with rg_give_item(id, szWeaponName, GT_APPEND)

I'll post the better solution using native later.
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#22

Post by Spir0x » 6 years ago

Thnaks :)

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#23

Post by Spir0x » 6 years ago

with this code i got 3 freez nades and 2 fire nades and i already replaced GT_APPEND and the m249 still appear when i choose another one.
now no need to add the models becuz i'm using new_weapons.ini :D

Code:

Code: Select all

#include <ze_vip>
 
public plugin_init()
{
    register_plugin("VIP Features", "1.0", "Raheem")
}
 
public ze_user_humanized(id)
{
    // Not Admin? Exit the function...
    if (!is_user_alive(id) || !(ze_get_vip_flags(id) & VIP_A) || ze_is_user_zombie(id))
        return
   
    // Give M249
    rg_give_item(id, "weapon_m249", GT_APPEND)
    rg_set_user_bpammo(id, WeaponIdType:get_weaponid("weapon_m249"), 200)
   
    // Give x2 Fire Nades
    rg_give_item(id, "weapon_hegrenade", GT_APPEND)
    rg_set_user_bpammo(id, WeaponIdType:get_weaponid("weapon_hegrenade"), rg_get_user_bpammo(id, WeaponIdType:get_weaponid("weapon_hegrenade")) + 1)
   
    // Give x2 Frost Nades
    rg_give_item(id, "weapon_flashbang", GT_APPEND)
    rg_set_user_bpammo(id, WeaponIdType:get_weaponid("weapon_flashbang"), rg_get_user_bpammo(id, WeaponIdType:get_weaponid("weapon_flashbang")) + 1)
}

User avatar
TheWhitesmith
Member
Member
Morocco
Posts: 33
Joined: 6 years ago
Location: Temara/Rabat
Contact:

#24

Post by TheWhitesmith » 6 years ago

I believe the weapons plugin has an option that strips the weapon from the player. If you don't have the source to remove it you may want to create a menu option inside VIP Menu where he can get M249 if he doesnt have it without stripping user weapons, so he will have the weapon he choose + M249.
[SYA] CSGO-Mod for CS 1.6 [ Cases/Keys/Rank ][/size]
IP: 149.202.251.74:27016

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#25

Post by Spir0x » 6 years ago

in another servers he take this minigun with out any menu.
and i dont know how to make VIP menu inside main menu.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#26

Post by Spir0x » 6 years ago

I'm still want this useful plugin.
Minigun VIP
Best Solution Raheem is make it on Extra-Items like you said.
3. Minigun \w[\rVIP\w]

or add natives into ze_weapon_menu to make this minigun fixed for vips.

also normal players will never use m249.
if weapon be restricted or something.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#27

Post by Raheem » 6 years ago

Open ze_weapons_menu.sma and find this:
    1. public Buy_Primary_Weapon(id, selection)
    2. {
    3.     static szWeaponName[32]
    4.     ArrayGetString(g_szPrimaryWeapons, selection, szWeaponName, charsmax(szWeaponName))
    5.     new iWeaponId = get_weaponid(szWeaponName)
    6.    
    7.     // Strip and Give Full Weapon
    8.     rg_give_item(id, szWeaponName, GT_REPLACE)
    9.     rg_set_user_bpammo(id, WeaponIdType:iWeaponId, szMaxBPAmmo[iWeaponId])
    10.    
    11.     // Primary bought
    12.     g_bBoughtPrimary[id] = true
    13. }
Change to:
    1. public Buy_Primary_Weapon(id, selection)
    2. {
    3.     static szWeaponName[32]
    4.     ArrayGetString(g_szPrimaryWeapons, selection, szWeaponName, charsmax(szWeaponName))
    5.     new iWeaponId = get_weaponid(szWeaponName)
    6.    
    7.     // Strip and Give Full Weapon
    8.     rg_give_item(id, szWeaponName, GT_APPEND)
    9.     rg_set_user_bpammo(id, WeaponIdType:iWeaponId, szMaxBPAmmo[iWeaponId])
    10.    
    11.     // Primary bought
    12.     g_bBoughtPrimary[id] = true
    13. }
Clearly i only replaced GT_REPLACE with GT_APPEND. So it does not strip players weapon. This is what you need.
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#28

Post by Spir0x » 6 years ago

what about
native ze_giveminigun(id)
on ze_weapon_menu ?

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#29

Post by Raheem » 6 years ago

I don't remember. Tell me now what the problem and post final code you have.
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#30

Post by Spir0x » 6 years ago

i dont have a game server.

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 13 guests