View Single Post
sdz
Senior Member
Join Date: Feb 2012
Old 04-21-2018 , 14:10   Re: How to block map weapons like surf_ski_2_go
Reply With Quote #5

nasty code - set up g_MapItems to suit what you want deleted from the map, place RemoveItems() in OnMapStart
PHP Code:
/*
 * Any items that can be placed on the map
 */
char g_MapItems[][] = 
{
    
"item_ammo_357"//0
    
"item_ammo_357_large"//1
    
"item_ammo_ar2"//2
    
"item_ammo_ar2_altfire"//3
    
"item_ammo_ar2_large"//4
    
"item_ammo_crossbow"//5
    
"item_ammo_pistol"//6
    
"item_ammo_pistol_large"//7
    
"item_ammo_smg1"//8
    
"item_ammo_smg1_large"//9
    
"item_ammo_smg1_grenade"//10
    
"item_battery"//11
    
"item_box_buckshot"//12
    
"item_healthkit"//13
    
"item_healthvial"//14
    
"item_rpg_round"//15
    
"weapon_357"//16
    
"weapon_shotgun"//17
    
"weapon_ar2"//18
    
"weapon_crossbow"//19
    
"weapon_crowbar"//20
    
"weapon_frag"//21
    
"weapon_physcannon"//22
    
"weapon_pistol"//23
    
"weapon_rpg"//24
    
"weapon_smg1"//25
    
"weapon_stunstick" //26
};

/*
 * This is going to delete all items on the map
 */
void RemoveItems()
{
    for(
int X MaxClients 12048X++)
    {
        for(
int Y 027Y++)
        {
            if(
IsValidEntity(X))
            {
                
char sClassname[32];
                
GetEntityClassname(XsClassnamesizeof(sClassname));

                if(
StrEqual(sClassnameg_MapItems[Y], false))
                {
                    
AcceptEntityInput(X"kill");
                }
            }
        }
    }


Last edited by sdz; 04-21-2018 at 14:54.
sdz is offline