Raised This Month: $ Target: $400
 0% 

Deagle5_knifehandler


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
amokossi
Senior Member
Join Date: Apr 2008
Old 01-03-2011 , 07:31   Deagle5_knifehandler
Reply With Quote #1

deagle5_knifehandler

Hi everyone! I know there are lot of people asking for a Plugin for cs_deagle5 which allows only knife on bridge and also on the boxes. The Plugins which are already made for knife on bridge seem to work but you can't even make a Headshot with knife.

About the Plugin:
If a player gets higher than a z-value he automtically switches to knife (default) and can't be hurt by the deagle. So If you are on the bridge and the boxes you can't be shot by a deagle and the knife is forced (default). When you spawn it displays a Hudmessage if Knife on Bridge only is active or if on boxes also.
With this Plugin Headshot with knife is still working as normal.

Author:
Joschi
Amokossi - mainly testing and code snippets

Version:
1.0 - old
1.1

Modules needed:

Engine
Fun
Hamsandwich

Cvars:
amx_deagle5_knife - 1 knifearea on bridge; 0 knifearea off; (default 1)
amx_deagle5_boxes - 1 knifearea on bridge and boxes; 0 only bridge ; (default 1)
amx_deagle5_force_knife - 1 force knife in knifearea; 0 no force; (default 1)


Known Bugs:
none

Credits:
xx_sirhc_xx: cs_deagle5 - Knife on bridge; The Idea was here
ConnorMcLeod:cs_deagle5 - Knife on bridge; improvement for Headshot
Cheap_Suit: Knifezone Plugin; where we got the idea for the z value
Attached Files
File Type: sma Get Plugin or Get Source (Degale5_knifehandler.sma - 887 views - 2.5 KB)

Last edited by amokossi; 01-04-2011 at 03:30.
amokossi is offline
Send a message via ICQ to amokossi Send a message via MSN to amokossi
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 01-03-2011 , 08:10   Re: Deagle5_knifehandler
Reply With Quote #2

maybe you can indent your code..
if don't know how open the sma with
Amxx Studio go on -> Tools and then on -> Indenter thats all..

PHP Code:
public plugin_init()
{
register_plugin("Knife on bridge and boxes""1.0""Joschi&Ossi")

new 
nMap[12]
get_mapname(nMap11)

if (!
equali(nMap"cs_deagle5"))
{
pause("ad")
return
}

amx_deagle5knife register_cvar("amx_deagle5knife""0")

RegisterHam(Ham_TakeDamage"player""Player_TakeDamage")

to

PHP Code:
public plugin_init()
{
    
register_plugin("Knife on bridge and boxes""1.0""Joschi&Ossi")
    
    new 
nMap[12]
    
get_mapname(nMap11)
    
    if (!
equali(nMap"cs_deagle5"))
    {
        
pause("ad")
        return
    }
    
    
amx_deagle5knife register_cvar("amx_deagle5knife""0")
    
    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage")

__________________

Last edited by vato loco [GE-S]; 01-03-2011 at 08:16.
vato loco [GE-S] is offline
amokossi
Senior Member
Join Date: Apr 2008
Old 01-03-2011 , 09:00   Re: Deagle5_knifehandler
Reply With Quote #3

Ok changed the .sma.
Sorry for this. My editor here on work messed it up.
amokossi is offline
Send a message via ICQ to amokossi Send a message via MSN to amokossi
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-03-2011 , 09:23   Re: Deagle5_knifehandler
Reply With Quote #4

If you use client_PreThink forward, include the appropriated module so forward can work.
Don't return PLUGIN_HANDLED in client_PreThink.
Don't show a hudmessage every prethink.

Use client_PreThink is a really bad idea, also there is no need to force player to use knife if you block damage.
I don't see what's new in your plugin excepted that you force knife also on boxes.
You should allow on boxe AND/OR on bridge.

Also, seems that you just copy/pasted code without understanding what you were doing.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-03-2011 at 09:27.
ConnorMcLeod is offline
amokossi
Senior Member
Join Date: Apr 2008
Old 01-03-2011 , 09:30   Re: Deagle5_knifehandler
Reply With Quote #5

I know many people asking for such a plugin which forces the knife on bridge and boxes. It's forced because player who don't know the "rule"(don't shoot on and from bridge) got their deagle in the hand and realise a few rounds later that they don't do dmage if they shoot from the bridge.
Even in your code you can shoot and do damage from the bridge.

*edit*
But ok please someone can close/delete this. We will use this on our Server and its working fine. If anyone needs this just send a PM.
amokossi is offline
Send a message via ICQ to amokossi Send a message via MSN to amokossi
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2011 , 09:42   Re: Deagle5_knifehandler
Reply With Quote #6

Unapproved on request.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-03-2011 , 09:53   Re: Deagle5_knifehandler
Reply With Quote #7

You should still fix your code.
About blood, hook traceattack instead of takedamage.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
amokossi
Senior Member
Join Date: Apr 2008
Old 01-03-2011 , 14:55   Re: Deagle5_knifehandler
Reply With Quote #8

Thx Connor!

New version online.


If possible can someone put it back to new plugin submissions? Sorry ;)

Last edited by amokossi; 01-04-2011 at 04:30.
amokossi is offline
Send a message via ICQ to amokossi Send a message via MSN to amokossi
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-04-2011 , 10:39   Re: Deagle5_knifehandler
Reply With Quote #9

Submitted again on author's request.
__________________
Arkshine is offline
amokossi
Senior Member
Join Date: Apr 2008
Old 01-04-2011 , 11:27   Re: Deagle5_knifehandler
Reply With Quote #10

Thanks.

Far away from getting this approved?

best regards
Amokossi
amokossi is offline
Send a message via ICQ to amokossi Send a message via MSN to amokossi
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 06:38.


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