Raised This Month: $51 Target: $400
 12% 

Subplugin Submission [ZP] Addon : Simple AP Limit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 02-21-2012 , 18:20   [ZP] Addon : Simple AP Limit
Reply With Quote #1

[ZP] Addon : Simple AP Limit

[Description]
This is very simple plugin which offers you to limit ammo packs ammount of any player.
I made it for my server , but i wanted to share it with you.
Plugin is bug free.
I hope you like it!

[Cvars]
There is only one cvar which allows you to easily set up limit.
PHP Code:
zp_ammo_limit 
Default value of cvar is 100.

[Author]
gogicaa

[Changelog]
Version 1.0 : First released version

[Download]
Attached Files
File Type: sma Get Plugin or Get Source (zp_addon_simple_ap_limit.sma - 2975 views - 616 Bytes)
gogicaa is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-22-2012 , 03:33   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #2

Simple yet effective. (:
__________________
H.RED.ZONE is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 02-22-2012 , 13:23   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #3

Good job.
Gam3ronE is offline
poliisi299
Senior Member
Join Date: May 2011
Old 02-23-2012 , 12:01   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #4

Nice ^.^
poliisi299 is offline
Nick Haldem
Senior Member
Join Date: Jun 2011
Location: Moldova
Old 02-23-2012 , 13:23   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #5

Great.If I have ammo bank without limit of saving.It will set my costum limit with this plugin?
Nick Haldem is offline
Send a message via Skype™ to Nick Haldem
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 02-23-2012 , 17:25   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #6

Quote:
Originally Posted by Nick Haldem View Post
Great.If I have ammo bank without limit of saving.It will set my costum limit with this plugin?
Yes ! I made this plugin because my bank system doesn't have limit option.
gogicaa is offline
zhulo
Senior Member
Join Date: Jun 2010
Location: Slovakia
Old 02-24-2012 , 19:09   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #7

stupid idea to use prethink
zhulo is offline
Send a message via ICQ to zhulo Send a message via Skype™ to zhulo
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 02-24-2012 , 20:10   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #8

Quote:
Originally Posted by zhulo View Post
stupid idea to use prethink
Yes , me too , using pre think is a bad way , it will think the function for every 0.1 second . So bad CPU usage .
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
zhulo
Senior Member
Join Date: Jun 2010
Location: Slovakia
Old 02-25-2012 , 05:26   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #9

Yes, it can cause lags on the server. Even with prethink, there is a smarter way of using:

PHP Code:
#include < amxmodx > 
#include < fakemeta >
#include < zombieplague > 
#include < engine > 

new ap_limit

public plugin_init() 

    
register_plugin("Simple AP Limit""1.0""gogicaa")
    
register_forward(FM_PlayerPreThink"fw_playerprethink")
    
    
ap_limit register_cvar("zp_ammo_limit","100")


public 
fw_playerprethink(id
{
    if (!
is_user_connected(id) || zp_get_user_ammo_packs(id) <= get_pcvar_num(ap_limit))
        return 
FMRES_IGNORED
    
    zp_set_user_ammo_packs
(id, (get_pcvar_num(ap_limit))) 
    
    return 
PLUGIN_CONTINUE

But, the much much better way is edit all the codes in zombie plague main and other plugins which adds players ammo packs and add the condition to dont give them ammo packs if they have more, or the same as limit.

Last edited by zhulo; 02-25-2012 at 05:27.
zhulo is offline
Send a message via ICQ to zhulo Send a message via Skype™ to zhulo
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-25-2012 , 07:01   Re: [ZP] Addon : Simple AP Limit
Reply With Quote #10

Try testing with AMXX Profile how many times is called zp_set_user_ammo_packs.

and later , obviusly , you can kill yourself lol
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 22:36.


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