Raised This Month: $95 Target: $400
 23% 

Refill ammo on kill (for CSDM)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 02-16-2009 , 07:22   Refill ammo on kill (for CSDM)
Reply With Quote #1

Hello .

I couldn't find this plug-in anywhere and decided to write it.

This plugin is for CSDM. When a player kills another player it's ammo in holder will be completely restored (like a "refill on kill" in GunGame).
Also supports auto-switch teamkills in normal CSDM and CSDMFFA.

Modules:
csdm
cstrike
fakemeta

Credits:
CSDM
GunGame AMXX
Fakemeta Utilities

Sorry, if this plug-in allready exists and for my bad English .
Attached Files
File Type: inc csdm.inc (8.1 KB, 4619 views)
File Type: sma Get Plugin or Get Source (csdm_refill.sma - 12145 views - 2.0 KB)

Last edited by TheRadiance; 02-23-2009 at 10:19.
TheRadiance is offline
Send a message via ICQ to TheRadiance
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 02-16-2009 , 09:03   Re: Refill ammo on kill (for CSDM)
Reply With Quote #2

GJ dude !

Thx for this I realy was looking for something like this for a respawn server.

I saw it on a server but I didn't find it. It sure was custom made by one of the server owners.
Costin83 is offline
Send a message via Yahoo to Costin83
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-23-2009 , 00:49   Re: Refill ammo on kill (for CSDM)
Reply With Quote #3

This plugin is well done.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 02-23-2009 , 03:34   Re: Refill ammo on kill (for CSDM)
Reply With Quote #4

Quote:
This plugin is well done.
If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.
I would like of course
TheRadiance is offline
Send a message via ICQ to TheRadiance
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-23-2009 , 09:28   Re: Refill ammo on kill (for CSDM)
Reply With Quote #5

PHP Code:
new const g_max_clip[] =
{
    
1310730,
    
30302025,
    
30353525,
    
12201030,
    
10083030,
    
207303050

Poor and inconsistent form; consider separating them each to be on a different line or revise the other variables to be in a similar format to this. Also, inconsistent use of semicolons.

PHP Code:
    for (new 0sizeof (g_other_weapons); a++)
        if (
wpnindex == g_other_weapons[a])
            return;

    if (!
csdm_get_ffa() && TK)
        return; 
Reorder these so that the second condition is first. The first loop is more expensive so it should be executed after the second.

PHP Code:
            new ammo get_weapon_maxclip(wpnindex);

            if (!
ammo)
                return;

            
client_cmd(killer"spk ^"items/9mmclip1.wav^"");
            
cs_set_weapon_ammo(weaponammo);
            return; 
This can be reordered to something like this:

PHP Code:
            new ammo get_weapon_maxclip(wpnindex);

            if (
ammo)
            {
                
client_cmd(killer"spk ^"items/9mmclip1.wav^"");
                
cs_set_weapon_ammo(weaponammo);
            }

            return; 
PHP Code:
get_weaponname(wpnidnamesizeof (name) - 1); 
I suggest using charsize.

PHP Code:
stock get_weapon_maxclip(wpnid 0)
// ...
stock fm_get_weapon_ent(idwpnid 0)
// ...
stock fm_find_ent_by_owner(id, const classname[], ownerjghgtype 0
Take the "stock" tag off, it's unnecessary.

For the most part, these are minor, but this is a small script.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 02-23-2009 , 10:20   Re: Refill ammo on kill (for CSDM)
Reply With Quote #6

@Hawk552

Thnx for suggest .
Optimized.
TheRadiance is offline
Send a message via ICQ to TheRadiance
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-24-2009 , 02:35   Re: Refill ammo on kill (for CSDM)
Reply With Quote #7

You could use this :
PHP Code:
new const g_iMaxClip[CSW_P90+1] = {
    -
1,  13, -110,  1,  7,    13030,  1,  30
        
2025303525,   12201030100
        
303020,  2,    73030, -1,  50
Then you could completly remove g_weapons and pass the weapon id like this to get maxclip :

g_iMaxClip[wpnindex]
__________________
- tired and retired -
ConnorMcLeod is offline
fjollerik
Member
Join Date: Jul 2007
Location: Denmark
Old 03-18-2009 , 13:28   Re: Refill ammo on kill (for CSDM)
Reply With Quote #8

My server cant load this plugin.. "Unknown"
This is what my server says
fjollerik is offline
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 03-18-2009 , 22:26   Re: Refill ammo on kill (for CSDM)
Reply With Quote #9

Quote:
Originally Posted by fjollerik View Post
My server cant load this plugin.. "Unknown"
This is what my server says
mine too
letgoofmyeggs is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 03-29-2009 , 22:57   Re: Refill ammo on kill (for CSDM)
Reply With Quote #10

Quote:
My server cant load this plugin.. "Unknown"
This is what my server says
Quote:
Quote:Originally Posted by fjollerik
My server cant load this plugin.. "Unknown"
This is what my server says

mine too
Check loaded modules:
Code:
Modules:
csdm
cstrike
fakemeta
TheRadiance is offline
Send a message via ICQ to TheRadiance
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 14:18.


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