AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Free ammo (https://forums.alliedmods.net/showthread.php?t=50704)

asstolavista 02-01-2007 20:40

Free ammo
 
1 Attachment(s)
This plugin gives Counter-Strike 1.6 players free full ammo for their weapons (primary and secondary) like Counter-Strike Source: on spawn, on buy and on new round. I used VEN's suggested events for new round and spawn.

Cvars:
- fa_enable, 1 to enable plugin (default is 1)
- fa_altclips, 1 to enable alternative method of filling backpack ammo by giving clips, for older versions of CS (default is 0)


Version 1.4
- New method for buy event, should be more general and reliable (I think)
Version 1.3
- Fixed ammo icon not showing with alternative method
- Fixed grenade ammo icon showing twice
Version 1.2
- Added ammo pickup icon on first spawn and on buy like CSS (alternative method still always shows max ammo instead of given ammo)
- Fixed misbehaviour on rare situation (must be exploited: disconnect with old-style menu open, reconnect on same slot and cmd menuselect)
- Fixed giving ammo outside buyzone
Version 1.1
- Added old-style menu support
- Added fa_enable and fa_altclips cvars
Version 1.0
- Initial version

soccdoodcss 02-02-2007 00:02

Re: Free ammo
 
Sweet, looks pretty well done.
I do remember liking that feature in CS:S, you just spawn and your on your way.

VEN 02-02-2007 05:16

Re: Free ammo
 
This will not work for buying through old-style buy menu.

Morpheus759 02-05-2007 10:43

Re: Free ammo
 
Quote:

Modification: ALL Category: Admin Commands
Really??

asstolavista 02-05-2007 11:48

Re: Free ammo
 
Quote:

Originally Posted by VEN (Post 434530)
This will not work for buying through old-style buy menu.

So for old-style menu I must keep track of the selections the player makes? Or is there a simplier way?

A more general way I see is relating the weapon pickup event message with the money event message, but I don't know how to do that effectively.

asstolavista 02-05-2007 11:49

Re: Free ammo
 
Quote:

Originally Posted by Morpheus759 (Post 435639)
Really??

I am absolutely sure I didn't choose "admin commands" but "gameplay", although I might have not chosen Counter-Strike as the mod, I didn't see it.

1NiteStand 02-05-2007 20:00

Re: Free ammo
 
i dont noe bout u guys but this is a pretty sweet plugin, i dont get y noe one thought of this before :] RAD PLUGIN!

asstolavista 02-06-2007 19:28

Re: Free ammo
 
Quote:

Originally Posted by asstolavista (Post 435665)
So for old-style menu I must keep track of the selections the player makes? Or is there a simplier way?

A more general way I see is relating the weapon pickup event message with the money event message, but I don't know how to do that effectively.

Please tell me something. I'll try the first way, tracking user menus and choices, but I don't know if that is correct or not.

As for the second way, I would have to catch all events to be sure there is nothing between weapon pickup and money event to make sure the weapon was bought, and I'm not going to do that unless someone more experient tells me that's ok (especially in terms of performance) and actually shows me how to catch all events. I'm thinking of a register_message cycle, but where can I get the minimum and maximum values for it? I can peek the .inc's and make it hardcoded, but you'd have to tell me that's ok as well.

asstolavista 02-07-2007 00:21

Re: Free ammo
 
Ok, I think I did it, just up'd version 1.1, please test it.

VEN 02-08-2007 10:01

Re: Free ammo
 
Hints: find_ent_by_owner, string is empty if !string[0], string[0] = 0 or string[0] = '^0' to empty string.

You should understand that command execution or menu keypress doesn't necessarily mean that buying will be performed. Therefore your plugin is incompatible with the AMX Mod X Restrict Weapons Plugin, plus, there is an issue with overriding old-style buy menu by other AMX Mod X registered menu.

As for your second idea i'd register FM_MessageBegin (see fakemeta.inc and fakemeta_const.inc).

Also there is a simple method of WeapPickup/Money messages gametime check, though the second way would be more accurate.


All times are GMT -4. The time now is 06:45.

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