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

[HELP] M249 + HE Bomb + Flash bomb models for VIPS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 04-10-2021 , 07:56   [HELP] M249 + HE Bomb + Flash bomb models for VIPS
Reply With Quote #1

Hi guys, can fix this guys M249 + HE BOMB + FLASH BOMBS Models For VIPS ADMIN_LEVEL_H
PHP Code:
#include <zombie_escape>

#define MODEL_MAX_LENGTH 64

// Models
new g_v_szMinigunModel[MODEL_MAX_LENGTH] = "models/VIPItems/v_m249_hum.mdl"
new g_p_szMinigunModel[MODEL_MAX_LENGTH] = "models/VIPItems/p_m249.mdl"

new g_v_szFrostGrenadeModel[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_frost.mdl"
new g_w_szFrostGrenadeModel[MODEL_MAX_LENGTH] = "models/zombie_escape/w_grenade_frost.mdl"

new g_v_szModelFireGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_fire.mdl"
new g_w_szModelFireGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/w_grenade_fire.mdl"

// Cvars
new cvar_dmgmultiplier

// Variables
new bool:g_bHaveMiniGun[33]

public 
plugin_natives()
{
    
register_native("ze_give_minigun""native_ze_give_minigun"1)
}

public 
plugin_init()
{
    
register_plugin("[Weapons] Minigun""1.0""Raheem")
    
    
// Cvars
    
cvar_dmgmultiplier register_cvar("ze_minigun_damage""1.5")
    
    
// Events
    
register_event("WeapPickup""CheckModel""b""1=19")
    
register_event("CurWeapon""CurrentWeapon""be""1=1")
    
    
// Forwards
    
register_forward(FM_SetModel"Fw_SetModel")
    
    
// HookChains
    
RegisterHookChain(RG_CBasePlayer_TakeDamage"Fw_TakeDamage_Post"1)
}

public 
plugin_precache() 
{
    
// Models
    
precache_model(g_v_szMinigunModel)
    
precache_model(g_p_szMinigunModel)
    
    
precache_model(g_v_szFrostGrenadeModel)
    
precache_model(g_w_szFrostGrenadeModel)
    
    
precache_model(g_v_szModelFireGrenade)
    
precache_model(g_w_szModelFireGrenade)
}

public 
ze_user_humanized(id)
{
    if (
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_task(0.1"Give_M249"id)
    }
}

public 
Give_M249(id)
{
    
native_ze_give_minigun(id)
    
    
// Set custom grenade model
    
cs_set_player_view_model(idCSW_FLASHBANGg_v_szFrostGrenadeModel)
    
cs_set_player_weap_model(idCSW_FLASHBANGg_p_szFrostGrenadeModel)
    
cs_set_player_view_model(idCSW_HEGRENADEg_v_szModelFireGrenade)
    
cs_set_player_weap_model(idCSW_HEGRENADEg_w_szModelFireGrenade)
}

public 
native_ze_give_minigun(player)
{
    
g_bHaveMiniGun[player] = true

    rg_remove_item
(player"weapon_m249")
    
rg_give_item(player"weapon_m249"GT_APPEND)
    
rg_set_user_bpammo(playerWeaponIdType:get_weaponid("weapon_m249"), 200)

    
ze_colored_print(player"!y+!tMinigun!y, !tDamage !gx%0.1f!y!"get_pcvar_float(cvar_dmgmultiplier))
}

public 
client_disconnect(id)
{
    
g_bHaveMiniGun[id] = false
}

public 
ze_user_infected(infected)
{
    if (
g_bHaveMiniGun[infected])
    {
        
g_bHaveMiniGun[infected] = false
    
}
}

public 
Fw_TakeDamage_Post(iVictimiInflictoriAttackerFloat:fDamagebitsDamageType)
{
    if (!
is_user_alive(iVictim) || !is_user_alive(iAttacker))
        return 
HC_CONTINUE
    
    
if (g_bHaveMiniGun[iAttacker] && (get_user_weapon(iAttacker) == CSW_M249))
    {
        
SetHookChainArg(ATYPE_FLOATfDamage get_pcvar_float(cvar_dmgmultiplier))
        return 
HC_CONTINUE
    
}
    return 
HC_CONTINUE
}

public 
CurrentWeapon(id)
{
    if ((
get_user_weapon(id) == CSW_M249) && g_bHaveMiniGun[id] == true)
    {
        
CheckModel(id)
    }
    return 
PLUGIN_CONTINUE
}

public 
CheckModel(id)
{
    if (
is_user_alive(id) && g_bHaveMiniGun[id] == true)
    {
        
set_pev(idpev_viewmodel2g_v_szMinigunModel)
        
set_pev(idpev_weaponmodel2g_p_szMinigunModel)
    }
    return 
PLUGIN_CONTINUE
}

public 
Fw_SetModel(entitymodel[])
{
    
    if(!
is_valid_ent(entity)) 
        return 
FMRES_IGNORED

    
if(!equali(model"models/w_m249.mdl"))
        return 
FMRES_IGNORED

    
static iOwneriStoredGlockID

    
// G3SG1 Owner
    
iOwner entity_get_edict(entityEV_ENT_owner)

    
// Get drop weapon index G3SG1
    
iStoredGlockID find_ent_by_owner(-1"weapon_m249"entity)

    
// If Player Has G3SG1
    
if(g_bHaveMiniGun[iOwner] && is_valid_ent(iStoredGlockID))
    {
        
// Setting weapon options
        
entity_set_int(iStoredGlockIDEV_INT_impulse55)
        
        
// Set weaponbox new model
        
entity_set_model(entityg_w_szMinigunModel)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

SHIFT0 is offline
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 04-10-2021 , 08:11   Re: [HELP] M249 + HE Bomb + Flash bomb models for VIPS
Reply With Quote #2

Quote:
Originally Posted by OciXCrom View Post
This is not the "do it for me" section. If you're not willing to collaborate, don't bother posting here.
__________________
nG_getwreck is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 04-10-2021 , 08:27   Re: [HELP] M249 + HE Bomb + Flash bomb models for VIPS
Reply With Quote #3

Can fix it ?
SHIFT0 is offline
Reply



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 06:48.


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