Raised This Month: $ Target: $400
 0% 

Hook Wars v1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 04-14-2015 , 11:50   Hook Wars v1.1
Reply With Quote #1

Hook Wars
v1.1



Description:
Based on Dota 2 Pudge and WC3 custom map Pudge Wars, I created this mode with this simple gameplay:
- Every player can only use knife.
- Every player can use "hook" by pressing USE and ATTACK2. A hook will be launch by player's aim, and if it touch any other, it will drag that player to the owner.) Note that you can hook your teammates too.
- Hook can deal damage, and disarm target (configurable by cvars)
- If a player get hooked when being dragged by another hook, the hooker will get an on-hook hook which kill the target instantly.

Features:

- Hook
- Dota 2 killstreak sounds.
- Block weapons pickup and buy.

Installation:
- Copy all the resource needed to the your cstrike folder
- Put the .sma file to your scripting folder, then compile it
- Go to compiled folder, copy the .amxx file to plugins folder, and add the filename to plugins.ini

Cvars:
hw_hookspeed (default 1200): speed of the hook
hw_hookdamage (default 50): damage of the hook
hw_disarm (default 3): 0 = no disarm; other value = disarm in seconds
hw_cooldown (default 4): how many seconds you have to wait before use hook again.

Screenshots/Video:

(sorry, I will add this later )

Changelogs:
Code:
v1.0: initial released
v1.1:
- added weapon pickup blocking
- removed client_PreThink
- fixed bug: no quakesound when you have 10+ killstreak
- some code improvement
Credits:
Valve: original idea & sounds
nnajko: for his block-buying method
tuty: for the message parts
HamletEagle & zmd94: for the start-hook part
Destro: for the dragging stuff
and many other coder helped me with this

Requirements:
AMX Mod X 1.8.2+ (I didn't test with previous versions)
Module: Fakemeta, Hamsandwich, Engine, Fun, Cstrike

To-do list:
- Deathmatch system
- A small shop with a few updates for hook and hookers

*Notes*:
This is my first gameplay and I'm new to Pawn coding, so this won't be perfect.
If you detect any bugs, feel free to report to me
Thanks for taking a look at this mode and hope you guys have a good time

Attached Files
File Type: zip hookwars.zip (1.61 MB, 285 views)
File Type: sma Get Plugin or Get Source (hookwars11.sma - 1016 views - 13.4 KB)
__________________

Last edited by Shiina.Mashiro; 04-17-2015 at 23:27. Reason: New version
Shiina.Mashiro is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-14-2015 , 13:28   Re: Hook Wars v1.0
Reply With Quote #2

It sounds interesting. I will see how it is when you upload a video, I don't playe cs since 1,5 year ago or so(I use it only to test stuffs), I can't try it.

Some code suggestions:

PHP Code:
register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon"
Is here a specific reason for registering this inside plugin_cfg and not plugin_init ?

PHP Code:
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0)) 
I would recommend to use real offset names, instead of their value, it makes your code more readable and we can understand what you are doing.

In plugin_precache several problems:
1)variable i is initialized two times, do it only one time.
2)Do not create new variables inside a loop(new soundfile[32]).
3)Use formatex(), not format().

PHP Code:
public Event_CurWeapon(id)
{
    new 
weapon read_data(2)
    if(
weapon != CSW_KNIFE && weapon != CSW_C4)
    {
        
strip_user_weapons(id)
        
give_item(id"weapon_knife")
    }

I don't know what your intentions are, but this code will strip bomb too(and I see you make a check for it, so I think it should be allowed).

Do not reindex an array.
__________________

Last edited by HamletEagle; 04-14-2015 at 13:29.
HamletEagle is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-14-2015 , 13:37   Re: Hook Wars v1.0
Reply With Quote #3

I think he just take that code from his ghost plugin, and forget about C4 part.
Kz1.0 is offline
silver-
Senior Member
Join Date: Jul 2006
Old 04-14-2015 , 17:45   Re: Hook Wars v1.0
Reply With Quote #4

Nice plugin, will test fore sure could be fun.

But I want to know why you gave credits to valve...
__________________


Need active admins for our zombie server. Just PM.
silver- is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 04-15-2015 , 05:11   Re: Hook Wars v1.0
Reply With Quote #5

Thanks for the replies guys
@HamletEagle
I read once about the difference between format() and formatex() but I can't understand it.
Can you help me about this ?

@Kz1.0
Actually not, I didn't test this mode in de_ map, gonna check it right now xD
Btw do you play any server in Vietnam?

@silver-
Because I took the idea and sounds from Dota 2, which is made by Valve
__________________
Shiina.Mashiro is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-15-2015 , 06:11   Re: Hook Wars v1.0
Reply With Quote #6

Sure, but I feel that this quote from amxmodx.org/api is enough:
Quote:
formatex:
Same as format(), except does not perform a "copy back" check.
This means formatex() is faster, but DOES NOT ALLOW this type
of call:
formatex(buffer, len, "%s", buffer)
formatex(buffer, len, buffer, buffer)
formatex(buffer, len, "%s", buffer[5])
This is because the output is directly stored into "buffer",
rather than copied back at the end.
In other words, formatex is faster and should be used. The only situation when you can't use it is when you format in the same string from where you get values.

PHP Code:
formatex(stringcharsmax(string), "%s"string
Is invalid.
__________________

Last edited by HamletEagle; 04-15-2015 at 06:12.
HamletEagle is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-15-2015 , 06:18   Re: Hook Wars v1.0
Reply With Quote #7

instead of using CmdStart to catch player using USE+ button try using FM_EmitSound checking for the "common/wpn_denyselect.wav" sound which is the USE+ button when not pressing a button. since you already have client prethink which uses alot of CPU.

using FM_EmitSound you can also stop that sound from playing everytime you use hook, which could get rather annoying if everyone in server is pressing USE+ all the time.

and instead of using Event_CurWeapon which gets executed alot more then just changing weapons, use Ham_Item_Deploy, and create a array with all the weapon names and loop thru registering them in plugin_init that way its only getting executed on weapons.
OR, just register Ham_Spawn and remove all weapons and give knife there... that would remove the need for CurWeapon or Ham_Item_Deploy...

just a couple ideas... thats my 2 cents
__________________

Last edited by Blizzard_87; 04-15-2015 at 06:20.
Blizzard_87 is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-15-2015 , 06:23   Re: Hook Wars v1.0
Reply With Quote #8

Quote:
Originally Posted by Shiina.Mashiro View Post
@Kz1.0
Actually not, I didn't test this mode in de_ map, gonna check it right now xD
Btw do you play any server in Vietnam?
e
Of course I do, mostly fun/kz servers. But since I got to university I don't play often.
Kz1.0 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-15-2015 , 06:36   Re: Hook Wars v1.0
Reply With Quote #9

Quote:
Reply With Quote Multi-Quote This Message Quick reply to this message #7
instead of using CmdStart to catch player using USE+ button try using FM_EmitSound checking for the "common/wpn_denyselect.wav" sound which is the USE+ button when not pressing a button. since you already have client prethink which uses alot of CPU.
+use sound can be changed by other plugins. I don't say that this is not a better way, but that it can be very easy tricked.
Also, instead of client_PreThink, you may try to use a task or a thinking entity. Do you really need to do this "20 times per second" ?
__________________

Last edited by HamletEagle; 04-15-2015 at 06:39.
HamletEagle is offline
Gpl
New Member
Join Date: Apr 2015
Old 04-15-2015 , 13:25   Re: Hook Wars v1.0
Reply With Quote #10

Such game is already in Alpha by another developers:

http://www.hookwarsonline.com/

But good luck in any case.
Gpl 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:08.


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