[ReQ] Instead of VIP Features.

Unpaid Requests, Public Plugins
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 553
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

[ReQ] Instead of VIP Features.

#1

Post by Spir0x » 1 Year Ago

Yo all, i already requested this plugin 4 - 5 months ago as it's useful sometimes.

Give m249 automatically for VIPs when round starts with p_ and v_ models and w_ if possible, then i've the models.

Give x1 fire nade, x1 frost nade, as normal player have 1 from fire and one from frost, So VIPs will get x2 of each nades :)

I hope my plugin request mark solved as soon becuz it's useful for me.

Peace :D

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#2

Post by Raheem » 1 Year Ago

And at this time when you request it i already made it for you. Search back and get it.
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 553
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#3

Post by Spir0x » 1 Year Ago

Where ? lol i've already explained more i said with models u made just weapons not models please i need it.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#4

Post by Raheem » 1 Year Ago

So ok, Where the old one so i edit it you?
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 553
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#5

Post by Spir0x » 1 Year Ago

Bro you should see the code first fixed or not.
you must remove ze_is_user_zombie(id)) & if (!is_user_alive(id) i know.
but wait now vips will get 3 nades must remove one of each nades from this code !
take:

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)
}
Last edited by Spir0x on 26 Nov 2017, 17:52, edited 1 time in total.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#6

Post by Raheem » 1 Year Ago

OK, I'll do it you
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 553
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#7

Post by Spir0x » 1 Year Ago

reply updated :)

i added

you must remove ze_is_user_zombie(id)) & if (!is_user_alive(id) i know.
but wait now vips will get 3 nades must remove one of each nades from this code !

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#8

Post by Raheem » 1 Year Ago

Try and let me know how it's going:
  • 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 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)
    }
    
    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
    }
You don't know? Learn and you will know.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 553
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#9

Post by Spir0x » 1 Year Ago

Ok bro, Still 2 little problems
first this give x2 nades i said 1 nade from zombie_escape.cfg and one from this plugin.
second is when i respawn i'm urgent to take another weapons & pistol when i take weapon this m249 appears !

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 553
Joined: 1 Year Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 6 times
Age: 18
Contact:

#10

Post by Spir0x » 1 Year Ago

Fixed ?

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests