Raised This Month: $51 Target: $400
 12% 

Change all weapons entities on fy_snow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blood2k
Senior Member
Join Date: Mar 2014
Old 09-10-2020 , 14:19   Change all weapons entities on fy_snow
Reply With Quote #1

Hey guys,

Just a fun little idea, any way somebody can make a plugin that changes the weapons on the ground on fy_ maps? More specific.. fy_snow ?

I'd like the ability to change all armour_entities on the ground to 1 random weapon every round. Kind of like a gun-game, but every round you spawn it's either All mp5's, all ak47's, all pistols.. etc.

Ofcourse, you'd probably have to blacklist a few things like.. shields.. smokes..flashes and things that don't make any sense at all.

Can keep:
rifles/smgs/pistols/shotguns/HE nades/knife round (remove all entities for a round?)
blood2k is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-11-2020 , 12:49   Re: Change all weapons entities on fy_snow
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>

enum
{
    
ARM_MP5
    
ARM_TMP,
    
ARM_P90,
    
ARM_MAC10,
    
ARM_AK47,
    
ARM_SG552,
    
ARM_M4A1,
    
ARM_AUG,
    
ARM_SCOUT,
    
ARM_G3SG1,
    
ARM_AWP,
    
ARM_M3,
    
ARM_XM1014,
    
ARM_M249,
    
ARM_FLASHBANG,
    
ARM_HEGRENADE,
    
ARM_KEVLAR,
    
ARM_ASSAULT,
    
ARM_SMOKEGRENADE
}

new const 
ArmouryEntityModels[][] = 
{
    
"models/w_mp5.mdl",       
    
"models/w_tmp.mdl",        
    
"models/w_p90.mdl",    
    
"models/w_mac10.mdl",       
    
"models/w_ak47.mdl",       
    
"models/w_sg552.mdl",       
    
"models/w_m4a1.mdl",       
    
"models/w_aug.mdl",        
    
"models/w_scout.mdl",      
    
"models/w_g3sg1.mdl",      
    
"models/w_awp.mdl",         
    
"models/w_m3.mdl",          
    
"models/w_xm1014.mdl",    
    
"models/w_m249.mdl",        
    
"models/w_flashbang.mdl",   
    
"models/w_hegrenade.mdl",  
    
"models/w_kevlar.mdl",
    
"models/w_assault.mdl",     
    
"models/w_smokegrenade.mdl"
}

const 
XO_CArmoury 
const m_iType 34

new const BlacklistedItems = (<< ARM_FLASHBANG) | (<< ARM_SMOKEGRENADE)
new const 
CArmoury[] = "armoury_entity"

public plugin_init()
{
    
register_event("HLTV""OnNewRoundEvent""a""1=0""2=0"
}

public 
OnNewRoundEvent()
{
    new 
items[ARM_SMOKEGRENADE 1]
    new 
index
    
for(new ARM_MP5<= ARM_SMOKEGRENADEi++)
    {
        if(
BlacklistedItems & (<< i))
        {
            continue
        }
        
        
items[index++] = i
    
}
    
    new 
itemIndex random_num(0index 1)
    new 
item items[itemIndex]
    new 
newModel[64]
    
copy(newModelcharsmax(newModel), ArmouryEntityModels[itemIndex])
    
    new 
target = -1
    
while((target find_ent_by_class(targetCArmoury)))
    {
        if(
pev_valid(target))
        {
            
set_pdata_int(targetm_iTypeitemXO_CArmoury)
            
engfunc(EngFunc_SetModeltargetnewModel)
        }
    }

Here you go.

c4, knife, pistols, famas, galil, shield can't be added to an armoury_entity.
To blacklist an item add it inside BlacklistedItems, following the pattern: | (1 << ARM_*).
Don't test alone, HLTV event isn't fired unless the game starts(or if you do, type "kill" once in console).
In case something goes wrong, double check the models names, I probably made some typos.
To enable the plugin only in certain maps use a custom plugins.ini file.
__________________

Last edited by HamletEagle; 09-11-2020 at 12:52.
HamletEagle is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 09-12-2020 , 03:32   Re: Change all weapons entities on fy_snow
Reply With Quote #3

Hi, thank you sir! ��☺️
blood2k is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-12-2020 , 15:40   Re: Change all weapons entities on fy_snow
Reply With Quote #4

You are welcome.
(maybe also check your steam messages when you have the time)
__________________
HamletEagle 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 19:36.


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