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

Subplugin Submission [ZP] Extra item: Remove Grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-01-2012 , 21:26   [ZP] Extra item: Remove Grenade
Reply With Quote #1

[ZP] Extra item: Remove Grenade


Info
:
Extra item for Zombies. (Small number of extra items for zombies)
Removes grenades (Fire, Frost, Flare, Force field, Kill bomb)
This is same code as my "Anti Infect Bomb"
This was made because of request.


How to use
:
Simple just buy it and every
bomb in range will be removed.
Plugin has no cvars.

In zp 5.0 version added cvars

Code:
    cvar_enable_remover = 1
    cvar_enable_zombie_remover = 1
    cvar_nemesis_remover = 1
How it works:
Click

Errors
:
If you find any please post



Changelog:

Code:
1.0 - release
1.1 - fixed maxplayers
1.2 - fixed invalid player errors
1.3 - Long range fixed
1.4 - Full fix
1.5 - Fixed run time error
      Added ColorChat

Added zp 5.0 version

1.0 - Added new cvars fixed the code from zp version
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_item_remover_1.5.sma - 895 views - 3.4 KB)
File Type: sma Get Plugin or Get Source (zp50_grenade_remover.sma - 1386 views - 4.7 KB)
__________________

Last edited by H.RED.ZONE; 04-01-2012 at 07:58.
H.RED.ZONE is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 03-02-2012 , 01:36   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #2

Wow this is much useful plugin. I will test it right away ;)

Still affecting force shield & sometimes fire, frost nade affecting. No error logs in debug
__________________

Last edited by naSTR; 03-02-2012 at 02:36.
naSTR is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-02-2012 , 03:56   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #3

Just higher range. And for the force field it removes it but not when its activated.
__________________

Last edited by H.RED.ZONE; 03-02-2012 at 04:02.
H.RED.ZONE is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 03-02-2012 , 13:06   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #4

cache get_maxplayers() , not all servers has 32 slots . and HLTV event doesnt have params.
__________________
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
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-02-2012 , 13:22   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #5

Ups updated...
__________________
H.RED.ZONE is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 03-03-2012 , 08:10   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #6

I guess, using only Engine is possible, right?

PHP Code:
/*
//------------------------------------------------------
This is: [ZP] Remove Grenade
//------------------------------------------------------ 
Description: Extra item for zombies.
Removes grenades (Fire, Frost, Flare, Force field, Kill bomb)
This is same code as my "Anti Infect Bomb"
This was made because of request.
//------------------------------------------------------
Edit: Only thing you need to edit is the range that you want (default 150)
//------------------------------------------------------ 
Version 1.0 - Release
//------------------------------------------------------
*/

//------------------------------------------------------
//Include
//------------------------------------------------------

#include <amxmodx>
#include <engine>
#include <zombieplague>

//------------------------------------------------------

new g_itemid_buyremoverg
new bool:g_removeg[33]

//------------------------------------------------------
//Register
//------------------------------------------------------

public plugin_init()
{
    
//------
    
register_plugin("[ZP] Extra item: Remover""1.0""H.RED.ZONE")
    
//------    
    
register_event("HLTV""NewRG""a""1=0""2=0")
    
//------    
    
g_itemid_buyremoverg zp_register_extra_item("Remover - Remove Grenades" 20 ZP_TEAM_ZOMBIE)
    
//------    
}

//------------------------------------------------------
//------------------------------------------------------
//------------------------------------------------------
public zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid_buyremoverg)
    {
        
client_print(playerprint_chat"[ZP] You bought Remover (Grenades cant hurt you)")    
        
g_removeg[player] = true
    
}
    
}

//------------------------------------------------------

public client_PreThink(id)
{
    if(
is_user_connected(id))
    {
        if(
g_removeg[id])
        {
            new 
infnade find_ent_by_class(-1"grenade")
            
            new 
Distance get_entity_distance(infnadeid)
            new 
owner entity_get_edict(infnadeEV_ENT_owner)
            
            if(
Distance <= 150 && !zp_get_user_zombie(owner))  //change range here
            
{
                
remove_entity(infnade)
            }
        }
    }
}

//------------------------------------------------------

public NewRG(i,id)
{
    if (
g_removeg[i])
    {
        
g_removeg[i] = false
    
}

Untested. Only uses Engine.

Last edited by Excalibur.007; 03-03-2012 at 08:10.
Excalibur.007 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-03-2012 , 08:20   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #7

Hmm ill look it up. It would lower cpu usage.
__________________
H.RED.ZONE is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 03-03-2012 , 08:30   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #8

Quote:
Originally Posted by H.RED.ZONE View Post
Hmm ill look it up. It would lower cpu usage.
You could also change is_user_connected & the boolean to bits. It's better that way. Even if you do not want to use CVars. Do something like

PHP Code:
new const Distance 150
//or
const Distance 150 
Got to go, bye.

Last edited by Excalibur.007; 03-03-2012 at 08:31.
Excalibur.007 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-03-2012 , 08:36   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #9

For easy edit but still the code is small anyone can edit it, ill take you opinion in the future, thanks.
__________________
H.RED.ZONE is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 03-04-2012 , 02:05   Re: [ZP] Extra item: Remove Grenade
Reply With Quote #10

@Exacalibur

PHP Code:
new const Distance 360 
should be

PHP Code:
new const Distance[] = 360 
or

PHP Code:
new const Distance[] = "360" 
?? just a question .
__________________
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
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 05:07.


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