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

Create "Dueling Box"


Post New Thread Reply   
 
Thread Tools Display Modes
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-14-2014 , 04:12   Re: Create "Dueling Box"
Reply With Quote #11

You should compile it against latest SourceMod libraries. Or get this one (already edited, but not tested).
Attached Files
File Type: sp Get Plugin or Get Source (sm_zones.sp - 129 views - 76.0 KB)
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 01-14-2014 , 05:58   Re: Create "Dueling Box"
Reply With Quote #12

In the end I just removed those sections of code because I only plan on using this for tf2.
keyboard1333 is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-14-2014 , 11:59   Re: Create "Dueling Box"
Reply With Quote #13

Quote:
Originally Posted by keyboard1333 View Post
In the end I just removed those sections of code because I only plan on using this for tf2.
But why? this stock is used only once on plugin start and map start to precache materials for drawing zones for different games, and compile warning doesnt makes any sense really, its been made for older SM versions. Its wont affect server performance at all or something.
EDIT: I forgot to add that you should set zone punishment to 'melee only' to make 'dueling zone' working.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 01-14-2014 at 12:00.
Root_ is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-14-2014 , 15:09   Re: Create "Dueling Box"
Reply With Quote #14

OK so I've updated zone plugin. Integrated 'custom' punishments and forwards for plugins. Right now you can do something like this with latest zones plugin.
Code:
#include <sdkhooks> new bool:InCustomZone[MAXPLAYERS + 1]; public Plugin:myinfo = {     name        = "SM Zones Custom Punishment Test",     author      = "Root",     description = "Testsuite for global Zones forwards",     version     = "1.0",     url         = "http://www.dodsplugins.com/" } public OnClientPutInServer(client) {     InCustomZone[client] = false;     SDKHook(client, SDKHook_TraceAttack,  TraceAttack);     SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); } public Action:OnEnteredProtectedZone(client, const String:prefix) {     if (1 <= client <= MaxClients)     {         InCustomZone[client] = true;         PrintToChatAll("%sYou have entered Dueling zone. You will not take damage outside of this zone", prefix);     } } public Action:OnLeftProtectedZone(client, const String:prefix) {     if (1 <= client <= MaxClients)     {         InCustomZone[client] = false;         // It's also called whenever player dies within a zone, so dont show a message if player died there         if (IsPlayerAlive(cleint))             PrintToChatAll("%sYou have left Dueling zone. You will take damage properly", prefix);     } } public Action:TraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup) {     return (InCustomZone[attacker] && InCustomZone[victim]) ? Plugin_Continue : Plugin_Handled; } public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype) {     return (InCustomZone[attacker] && InCustomZone[victim]) ? Plugin_Continue : Plugin_Handled; }
Attached Files
File Type: sp Get Plugin or Get Source (sm_zones_test.sp - 35 views - 1.5 KB)
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 01-14-2014 , 17:05   Re: Create "Dueling Box"
Reply With Quote #15

In the end I editted it so that it would work for my needs before I saw your new code, but thankyou anyways.

I do have two questions (features that I'd like to add):
How would I prevent people building in the box(s).
How would I stop people throwing sandviches into the box(s)

Thanks
keyboard1333 is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-14-2014 , 17:20   Re: Create "Dueling Box"
Reply With Quote #16

I am not familiar with TF2, so I think you have to setup netprops for PDA building (like m_bDisposableBuilding), and sandwich (m_bBeingRepurposedForTaunt).
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 01-14-2014 , 17:25   Re: Create "Dueling Box"
Reply With Quote #17

Thanks for the response!!!
Unfortunately I have no clue how to go about doing that.
Perhaps someone could point me in the right direction?
keyboard1333 is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-14-2014 , 17:34   Re: Create "Dueling Box"
Reply With Quote #18

I assume TF2Items and TF2Attributes will do the trick, but I've never used it really.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 01-14-2014 , 17:58   Re: Create "Dueling Box"
Reply With Quote #19

Actually one small problem:

PHP Code:
                            if(vel[1] > 0.0 && vel[1] < 280.0)
                            
vel[1] = 200.0;
                            else if (
vel[1] < 0.0 && vel[1] > -200.0)
                            
vel[1] = -200.0;
                            if (
vel[2] > 0.0// Never push the activator up!
                                
vel[2] *= -0.1
If you rocketjump right into the middle of the top of the box it'll just let you drop in and knock you to the side a bit.
Would it be possible to make you just reverse and bounce a little? (e.g. you jump on the top and you go back up) I commented out the lines
PHP Code:
if (vel[2] > 0.0// Never push the activator up!
                                
vel[2] *= -0.1
But you can still get in.
keyboard1333 is offline
keyboard1333
Senior Member
Join Date: Aug 2013
Old 01-14-2014 , 18:28   Re: Create "Dueling Box"
Reply With Quote #20

And if its not too much trouble (I just thought of another thing) would a command to teleport a player in be ok? (based on the name of the zone).

I found the code used to tele but I'm not sure how to target certain zones with it.
keyboard1333 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 14:53.


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