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

[l4d2] single pickup weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-12-2010 , 15:37   [l4d2] single pickup weapons
Reply With Quote #1

can't find a mod that does this thourgh my search, so i apologize if someone already made it.
i want a plugin that makes every weapon a single item, so only on guy can pick up an ak-47, not all 4 of them.

someone made this already?
GanjaStar is offline
SEGA EMPRESS ERIS
Senior Member
Join Date: Sep 2010
Location: THE-MILKY-WAY-GALAXY
Old 11-13-2010 , 11:05   Re: [l4d2] single pickup weapons
Reply With Quote #2

This should work for you.
PHP Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0.0"
new Handle:entity_update;
public 
Plugin:myinfo =
{
     
name "l4d2entityupdate",
     
author "unknown",
     
description "increase or decrease entity counts",
     
version PLUGIN_VERSION,
     
url "sourcemod.net"
};
public 
OnPluginStart()
{
     
entity_update CreateConVar("entity_update""1","entity update is on/off",FCVAR_PLUGIN|FCVAR_NOTIFY);
     
AutoExecConfig(true"l4d2entityupdate")
     
HookEvent("round_start"RoundStartEventHookMode_Post);
}
public 
RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
     if(
GetConVarInt(entity_update) == 1)
     {
      
CreateTimer(3.0UpdateCounts0);
     } 
}
public 
Action:UpdateCounts(Handle:timer)
{
     
UpdateEntCount("weapon_autoshotgun_spawn","1");
     
UpdateEntCount("weapon_hunting_rifle_spawn","1");
     
UpdateEntCount("weapon_pistol_spawn","1");
     
UpdateEntCount("weapon_pistol_magnum_spawn","1");
     
UpdateEntCount("weapon_pumpshotgun_spawn","1");
     
UpdateEntCount("weapon_rifle_spawn","1");
     
UpdateEntCount("weapon_rifle_ak47_spawn","1");
     
UpdateEntCount("weapon_rifle_desert_spawn","1");
     
UpdateEntCount("weapon_rifle_sg552_spawn","1");
     
UpdateEntCount("weapon_shotgun_chrome_spawn","1");
     
UpdateEntCount("weapon_shotgun_spas_spawn","1");
     
UpdateEntCount("weapon_smg_spawn","1");
     
UpdateEntCount("weapon_smg_mp5_spawn","1");
     
UpdateEntCount("weapon_smg_silenced_spawn","1");
     
UpdateEntCount("weapon_sniper_awp_spawn","1");
     
UpdateEntCount("weapon_sniper_military_spawn","1");
     
UpdateEntCount("weapon_sniper_scout_spawn","1");
     
UpdateEntCount("weapon_grenade_launcher_spawn""1");
     
UpdateEntCount("weapon_spawn""1");
     
UpdateEntCount("weapon_chainsaw_spawn""1");
     
UpdateEntCount("weapon_rifle_m60_spawn""1");
     
UpdateEntCount("weapon_first_aid_kit_spawn""1");
     
UpdateEntCount("weapon_melee_spawn""1");
     
UpdateEntCount("weapon_pistol_spawn""1");
     return 
Plugin_Handled;
 
}
public 
UpdateEntCount(const String:entname[], const String:count[])
{
     
// LogAction(0, -1, "DEBUG:updateentcount");
     
new edict_index FindEntityByClassname(-1entname);
     while(
edict_index != -1)
     {
          
DispatchKeyValue(edict_index"count"count);
          
edict_index FindEntityByClassname(edict_indexentname);
     }

SEGA EMPRESS ERIS is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-13-2010 , 11:40   Re: [l4d2] single pickup weapons
Reply With Quote #3

wow man, thanks a bunch. will give it a go to see if it conflicts with any of my plugins.

I owe you one XJR15.
GanjaStar is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-13-2010 , 20:57   Re: [l4d2] single pickup weapons
Reply With Quote #4

works in coop, but not in versus. my guess is its conflicting with SRS mod.

Last edited by GanjaStar; 11-13-2010 at 22:02.
GanjaStar is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-17-2010 , 14:26   Re: [l4d2] single pickup weapons
Reply With Quote #5

if anyone knows how to do this and have it work with SRS mod mentioned in the previous post, im willing to give you a l4d 2 windows server for 1 month.

im a layman, and no one else wants or knows how to help.
GanjaStar is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-18-2010 , 12:49   Re: [l4d2] single pickup weapons
Reply With Quote #6

damn, looks like this ain't gonna happen

anyways offer stills tands, even after i stop bumping.

4 AK 47-s, or 4 autoshoties... its a joke, and no t2= a lot of raging and complaining.
GanjaStar is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-18-2010 , 17:49   Re: [l4d2] single pickup weapons
Reply With Quote #7

It's very easy to do.

Hook player_use, check the entity used against being a t2 gun, remove entity if it is a t2 gun.
AtomicStryker is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-18-2010 , 18:43   Re: [l4d2] single pickup weapons
Reply With Quote #8

Quote:
Originally Posted by AtomicStryker View Post
It's very easy to do.

Hook player_use, check the entity used against being a t2 gun, remove entity if it is a t2 gun.
yeah, easy for one of the top 5 most productive and active moders on the forum maybe

basically, i have no idea what your post says. but i guess i will google it, because i really want single pickup t2s.

thx for the hint. i know how much you dislike spoonfeeding noobs like me, so its very appreciated.
GanjaStar is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-19-2010 , 23:26   Re: [l4d2] single pickup weapons
Reply With Quote #9

Bumping this. if anyone understand what atomicstryker said, and how to make it. my offer still stands.

This is a very desired plugin, and even steam forums are now begging for it.

3 page thread in one day, requiesting single pickup weapons.
GanjaStar is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-20-2010 , 07:27   Re: [l4d2] single pickup weapons
Reply With Quote #10

Since i have 2 minutes

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

static const String:t2strings[][] = {
                                    
"weapon_autoshotgun",
                                    
"weapon_shotgun_spas",
                                    
"weapon_hunting_rifle",
                                    
"weapon_sniper",
                                    
"weapon_rifle"
                                    
};

public 
OnPluginStart()
{
    
HookEvent("player_use"Event_PlayerUse);
}

public 
Action:Event_PlayerUse(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
item GetEventInt(event"targetid");
    
    if (
IsValidEdict(item)
    && 
IsT2Gun(item))
    {
        
RemoveEdict(item);
    }
}

static 
bool:IsT2Gun(item)
{
    
decl String:itemname[64];
    
GetEdictClassname(itemitemnamesizeof(itemname));
    
    for (new 
0sizeof(t2strings); i++)
    {
        if (
StrContains(itemnamet2strings[i], false) != -1)
        {
            return 
true;
        }
    }
    
    return 
false;


EDIT:

For educatory purposes im leaving this. Note the strings in StrContains are swapped the wrong way, thus this plugin couldnt work.

Later post in this thread has functioning version

Last edited by AtomicStryker; 11-21-2010 at 06:43.
AtomicStryker 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 20:35.


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