AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Addon : Simple AP Limit (https://forums.alliedmods.net/showthread.php?t=178816)

gogicaa 02-21-2012 18:20

[ZP] Addon : Simple AP Limit
 
1 Attachment(s)
[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]

H.RED.ZONE 02-22-2012 03:33

Re: [ZP] Addon : Simple AP Limit
 
Simple yet effective. (:

Gam3ronE 02-22-2012 13:23

Re: [ZP] Addon : Simple AP Limit
 
Good job.

poliisi299 02-23-2012 12:01

Re: [ZP] Addon : Simple AP Limit
 
Nice ^.^

Nick Haldem 02-23-2012 13:23

Re: [ZP] Addon : Simple AP Limit
 
Great.If I have ammo bank without limit of saving.It will set my costum limit with this plugin?

gogicaa 02-23-2012 17:25

Re: [ZP] Addon : Simple AP Limit
 
Quote:

Originally Posted by Nick Haldem (Post 1655898)
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.

zhulo 02-24-2012 19:09

Re: [ZP] Addon : Simple AP Limit
 
stupid idea to use prethink

JoKeR LauGh 02-24-2012 20:10

Re: [ZP] Addon : Simple AP Limit
 
Quote:

Originally Posted by zhulo (Post 1656728)
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 .

zhulo 02-25-2012 05:26

Re: [ZP] Addon : Simple AP Limit
 
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.

lucas_7_94 02-25-2012 07:01

Re: [ZP] Addon : Simple AP Limit
 
Try testing with AMXX Profile how many times is called zp_set_user_ammo_packs.

and later , obviusly , you can kill yourself lol


All times are GMT -4. The time now is 15:58.

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