Raised This Month: $94 Target: $400
 23% 

Counter-Strike Duel Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Hawk552 (427)
mateo10
Veteran Member
Join Date: Jan 2006
Old 02-24-2007 , 10:13   Counter-Strike Duel Plugin
Reply With Quote #1

Counter-Strike Duel Plugin

Usage
When duel mod is started all players but 2 will be moved to spectator. The 2 not moved will be placed in CT and T team and will be given a M4A1, an USP and a knife. When ie. the CT player kills the T player a HUD message will be displayed in the center of the screen that says "<ctplayername> won the duel against <tplayername>" and the loser will be switched against another player from spectator.

Admin Commands
csdp_enable 1/0 - Enable/Disable plugin (Default 1)
csdp_saveduels 1/0 - Save duels/Don't save duels (Default 1)
csdp_votestostop # - Decides how many votes needed to stop duelmod (Default 5)
csdp_startduel - Starts duel mod
csdp_stopduel - Stops duel mod

User Commands
say !duelstats - Shows your duels won and lost (if csdp_saveduels is 1 it is saved by vault)
say !stopduel - Votes to stop duelmod. Number of votes required is decided by the cvar csdp_votestostop

Modules Needed
CStrike
Fun
Engine

Good to know
When duel mod is started noone can choose teams. After duel mod is stopped you can choose teams again.

Credits
Servak (ideas)
Fadeproof18 (ideas)

Updates
1.0

- Release for public.
1.0b

- Plugin will now work for dedicated servers.
- Added !stopduel votecommand for players.
1.0c

- Fixed the player checks (Suggested by VEN)
- Fixed another way to delete the bomb (Suggested by VEN)
- Added an ADMIN_LEVEL define which you can change to fit your level
- Now the players cant use jointeam or joinclass either
1.0d

- Changed the get_user_flags(id) to is_user_admin(id)
- NOW the players cant use jointeam or joinclass
- Fixed some of the bugs (Suggested by VEN)
1.1

- Fixed the bomb deleting event
- Moved the if(DuelMod) before the code in logevent_round_start()
Attached Files
File Type: sma Get Plugin or Get Source (csdp.sma - 5917 views - 6.1 KB)

Last edited by mateo10; 03-20-2007 at 08:14.
mateo10 is offline
FormulaZero
BANNED
Join Date: Feb 2007
Location: Sector 7G
Old 02-24-2007 , 12:50   Re: Counter-Strike Duel Plugin
Reply With Quote #2

:O

nice
FormulaZero is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 02-25-2007 , 08:21   Re: Counter-Strike Duel Plugin
Reply With Quote #3

this plugin works not correct.
when I type csdp_startduel in hlsw console the following error comes:
Code:
13:22:09 L 02/25/2007 - 13:19:31: [AMXX] Displaying debug trace (plugin "csdp.amxx")
13:22:09 L 02/25/2007 - 13:19:31: [AMXX] Run time error 10: native error (native "cs_set_user_team")
13:22:09 L 02/25/2007 - 13:19:31: [AMXX]    [0] csdp.sma::action_duel (line 151)
When i type ingame csdp_startduel the duel starts but it switch not every round. every 4 rounds or so it swich the player.
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 02-25-2007 , 08:36   Re: Counter-Strike Duel Plugin
Reply With Quote #4

Fixed. Download the updated plugin from the main post.

Last edited by mateo10; 02-25-2007 at 09:48.
mateo10 is offline
Old 02-25-2007, 08:50
mateo10
This message has been deleted by mateo10.
VEN
Veteran Member
Join Date: Jan 2005
Old 02-25-2007 , 13:02   Re: Counter-Strike Duel Plugin
Reply With Quote #5

Quote:
noone can choose teams
But i believe that they still can use jointeam/joinclass command to join.

Line #43: Your usage of EngFunc_FindEntityByString is incorrect, see fakemeta_const.inc. Also i have no idea of why would you want to search for a planted bomb on round start? Do you aware that ent will be always equal to 0?

Line #46: You should cache mapname into a global array.

Line #51-54: You don't even care to check whether player is alive or not.

Line #56: containi doesn't always return true on success. You have to read string.inc or view the function reference. Also map name technically means nothing. To check whether it's a bomb/defuse map you have to check for func_bomb_target entity existence and not for map name prefix.

Line #57: You don't even care to check whether ent is valid or not equal to 0.

Line #67: You don't even care to check whether killer is connected/not equal to 0.

Line #141, 176: There are a cmd_access stock function that should be used insted of such access check.
VEN is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 02-25-2007 , 15:55   Re: Counter-Strike Duel Plugin
Reply With Quote #6

Can I use
Code:
new ent = find_ent_by_model(0, "grenade", "models/w_c4.mdl"); if(find_ent_by_class(0, "func_bomb_target") && ent) {     remove_entity(ent); }
mateo10 is offline
FormulaZero
BANNED
Join Date: Feb 2007
Location: Sector 7G
Old 02-25-2007 , 16:08   Re: Counter-Strike Duel Plugin
Reply With Quote #7

Yes this should work.
FormulaZero is offline
Old 02-25-2007, 16:14
mateo10
This message has been deleted by mateo10. Reason: Fixed it
VEN
Veteran Member
Join Date: Jan 2005
Old 02-26-2007 , 03:21   Re: Counter-Strike Duel Plugin
Reply With Quote #8

Line #33, 34: Where did you get that commands? This is not what i meant. It should be pure jointeam/joinclass, i.e. without say command and slash symbol.

Line #47: I have to repeat: I have no idea of why would you want to search for a planted bomb on round start? Do you aware that ent will be always equal to 0?

Line #51: Your alive check is inefficient, you have to use get_players with a corresponding flag to get only alive players, see amxmodx.inc or function reference for details.

Line #64-68: Should be placed after is_user_connected check.

Line #141, 176: cmd_access function should be used instead, see default plugins for example.

Line #169, 183: PLUGIN_HANDLED should be returned instead.
VEN is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 02-28-2007 , 13:01   Re: Counter-Strike Duel Plugin
Reply With Quote #9

@ mateo: do you want to update this ??
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 03-01-2007 , 03:01   Re: Counter-Strike Duel Plugin
Reply With Quote #10

I belive it works now.
mateo10 is offline
Reply


Thread Tools
Display Modes

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 23:12.


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