Raised This Month: $106 Target: $400
 26% 

DoD Pistol Ammo Clips


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Day of Defeat        Category:   Gameplay        Approver:   Exolent[jNr] (178)
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 08-04-2008 , 22:55   DoD Pistol Ammo Clips
Reply With Quote #1

DOD_PistolClips - For Day of Defeat 1.3
Written by Vet(3TT3V)

Version Update 3/12/09

Description:
Players drop their pistol when killed. Players can then pick up the pistol and get an ammo clip from it. Simple, but can be a lifesaver.

Options:
- If the 'active' CVar is ON, the pistol must be the active weapon when the player is killed. If OFF, pistol is dropped every time (default).
- If the 'usekey' CVar is ON (default), the player must press his 'Use' key to pick up the clip. If OFF, you can just walk over the pistol to pick up the clip.
- If the 'univ' (short for 'universal ammo') CVar is ON, players can pick up any type of pistol. If OFF (default), then the players can only pick up pistols they normally use. Meaning you can't pick up a Luger if you use Colt clips.

Commands:
dod_pistolclips - Toggles the plugin On and Off (access level 'h')

CVars:
dod_pistolclips_enable <0|1> Disables|Enables the plugin (default - 1)
dod_pistolclips_life <##> Lifetime (seconds) of the dropped pistol (default - 22)
dod_pistolclips_univ <0|1> All pistols use 'universal' ammo clips (default - 0)
dod_pistolclips_report <0|1> Say (in chat) if you picked up a clip (default - 1)
dod_pistolclips_usekey <0|1> Must press the 'Use' key to pick up a clip (default - 1)
dod_pistolclips_active <0|1> Only drop a pistol if using it when killed (default - 0)

Notes:
- Report feature is automatically disabled if using 'Universal' ammo and 'Active' is disabled. This keeps the chat from filling up since many clips are dropped and picked up.
- Compatability with other pistol/ammo plugins is unknown and not supported.
- Bots will not pick up dropped pistols

Installation:
- This plugin requires the supplied w_webley_v1.mdl model for the Webley pistol. Download, unzip, and place the model in your /dod/models/ folder. If applicable, you'll want to upload the model to your FastDownload server as well.
- This plugin requires the HamSandwich module.

Thanks:
- To Wilson[29th ID] at www.dodplugins.net for his 'Update Ammo HUD' tutorial.
- To Diamond-optic at www.dodplugins.net for webley model texture suggestion.

Version History:
v1.4 Added ammopickup soundbite
v1.3 Original Release


Version Update 3/12/09
-
Attached Files
File Type: zip w_webley_v1.zip (28.9 KB, 692 views)
File Type: sma Get Plugin or Get Source (dod_pistolclips.sma - 8343 views - 8.6 KB)
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 03-13-2009 at 00:40. Reason: Version update
Vet is offline
Send a message via MSN to Vet
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 08-05-2008 , 03:06   Re: [DOD] Pistol Ammo Clips
Reply With Quote #2

awesome! something i started doing a while back but never had time to finish it

so far so good cant wait to get it up on my public server
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-29-2008 , 23:45   Re: [DOD] Pistol Ammo Clips
Reply With Quote #3

Any confirmation that this works? Any bugs?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 09-30-2008 , 01:35   Re: [DOD] Pistol Ammo Clips
Reply With Quote #4

We've been using this plugin on our server since before I released it. It works great. I haven't found any problems yet. Join the server below and check it out, We'd be glad to have ya.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-30-2008 , 08:18   Re: [DOD] Pistol Ammo Clips
Reply With Quote #5

Sorry, but I don't play DOD.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 10-27-2008 , 18:05   Re: DOD Pistol Ammo Clips
Reply With Quote #6

it works.. but i made a small change so that it goes by the actual pistol that players are carrying and not by the team

added:
PHP Code:
#define OFFSET_WPN_ID    91
#define OFFSET_LINUX    4 
and
PHP Code:
stock dod_get_weapon_entidwpnid=0weaponname[] = "" ) {
    new 
ent = -1entidentname[32];

    
// Get User Origin
    
new Float:origin[3];
    
pevidpev_originorigin );
    
    
// Find Weapon
    
while( ( ent engfuncEngFunc_FindEntityInSphereentoriginFloat:1.0 ) ) != ) {
        if( 
pev_valid(ent) )
        {
            if( 
wpnid )
            {
                
entid get_pdata_intentOFFSET_WPN_IDOFFSET_LINUX );
                if( 
wpnid == entid ) return ent;
            }
            else if( 
weaponname[0] )
            {
                
peventpev_classnameentname31 );
                if( 
equal(entnameweaponname) ) return ent;
            }
        }
    }
    return 
0;

in event_death changed:
PHP Code:
p_type get_user_team(vid)
if (
p_type != AXIS)
    
p_type dod_get_map_info(MI_ALLIES_TEAM) ? BRITISH ALLIES 
to:
PHP Code:
if(dod_get_weapon_ent(vid,0,"weapon_colt"))
    
p_type ALLIES
else if(dod_get_weapon_ent(vid,0,"weapon_webley"))
    
p_type BRITISH
else
    
p_type AXIS 
and also in HAM_pistol_touch changed:
PHP Code:
p_team get_user_team(player)
if (
p_team != AXIS)
    
p_team dod_get_map_info(MI_ALLIES_TEAM) ? BRITISH ALLIES 
to:
PHP Code:
if(dod_get_weapon_ent(player,0,"weapon_colt"))
    
p_team ALLIES
else if(dod_get_weapon_ent(player,0,"weapon_webley"))
    
p_team BRITISH
else
    
p_team AXIS 
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 03-13-2009 , 08:56   Re: DoD Pistol Ammo Clips
Reply With Quote #7

Version update. See 1st post for details.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Reply


Thread Tools
Display Modes

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 13:45.


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