Raised This Month: $ Target: $400
 0% 

Blocker pervention on surf


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thiefsnip3r
Junior Member
Join Date: Aug 2005
Old 08-18-2005 , 20:28   Blocker pervention on surf
Reply With Quote #1

I was wondering if it has been made already or if someone will make it for me a plugin for surf maps to where it prevents people from blocking such as you can go through them. If this is possible please help me i am mad at all the people that cant surf.
__________________
thiefsnip3r is offline
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-18-2005 , 20:45  
Reply With Quote #2

Talk to hawk hes compiling a whole slew of surfing plugins and doing quite a good job at it too.
__________________
Sig Under Construction.
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
Blitz
Senior Member
Join Date: Jul 2005
Location: Google
Old 08-18-2005 , 21:31  
Reply With Quote #3

I'm modifying an existing plugin for surf. I'll probably hand it over to Hawk after.
__________________
[img]http://img268.**************/img268/7071/blitz4ek.jpg[/img]

In the beginning, God created the search button.
Blitz is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-18-2005 , 22:11  
Reply With Quote #4

Here:

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Surf Tools - Pass Through","1.0","Hawk552")     register_cvar("surf_passthrough","1")     new mapname[64]     get_mapname(mapname,63)     if(containi(mapname,"surf_")!=-1)     {         register_event("ResetHUD","set_passthrough","be")     } } public set_passthrough(id) {     if(get_cvar_num("surf_passthrough")==1)     {         if(is_user_alive(id)==1)         {             entity_set_int(id,EV_INT_solid,0)         }     }     return PLUGIN_HANDLED }

I'd actually add that to my surf plugins, but it doesn't exactly work properly. When someone falls to the bottom of the map, they don't die. There are numerous other problems, but I don't know what else I can do to make them pass-through-able without also taking away their interaction with entities (trigger_hurt is what makes people die when they get to the bottom of a map)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-18-2005 , 22:35  
Reply With Quote #5

Ah, I got this so far, but it seems to crash the server (even though it works)

Code:
#include <amxmodx> #include <engine> #include <fakemeta> public plugin_init()     {     register_plugin("Surf Tools - Pass Through","1.0","Hawk552")     register_cvar("surf_passthrough","1")     new mapname[64]     get_mapname(mapname,63)     if(containi(mapname,"surf_")!=-1)     {         //      register_event("ResetHUD","set_passthrough","be")         register_forward(FM_Touch,"set_passthrough2")     }     } public set_passthrough(id)     {     if(get_cvar_num("surf_passthrough")==1)     {         if(is_user_alive(id)==1)         {             entity_set_int(id,EV_INT_solid,0)         }     }     return PLUGIN_HANDLED } public set_passthrough2(ptr,ptd)     {     if(is_valid_ent(ptd)==1)     {         if(is_user_alive(ptd)==1)         {             entity_set_int(ptd,EV_INT_solid,0)             set_task(5.0,"unsolid",ptd)         }     }     return PLUGIN_HANDLED } public unsolid(ptd)     {     if(is_user_alive(ptd)==1)     {         entity_set_int(ptd,EV_INT_solid,1)     } }

This is beyond me at this point. I never actually learned engine or fakemeta.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Blitz
Senior Member
Join Date: Jul 2005
Location: Google
Old 08-18-2005 , 22:37  
Reply With Quote #6

I think I can fix that up. What map does it most have problems? I can test it out.
__________________
[img]http://img268.**************/img268/7071/blitz4ek.jpg[/img]

In the beginning, God created the search button.
Blitz is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-18-2005 , 22:46  
Reply With Quote #7

I think the problem is in setting solid back to 1 after the touch. Also touching seems to be extremely delayed, maybe there's a way to detect if 2 players are within a certain distance of each other, using origins.

If they are then a certain distance apart, their solid is set back to 1.

If that makes any sense...

I've only tested it on surf_egypt.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-18-2005 , 22:48  
Reply With Quote #8

Check out my plugins they basically all use resulting distance...

get_user_origin(player1, location1)
get_user_origin(player2, location2)

new resultingdistance
resultingdistance = distance(location1, location2)

if (resultingdistance <= *insert distance here*)
set solid
__________________
Sig Under Construction.
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-18-2005 , 22:51  
Reply With Quote #9

OH NO WAIT! omg i got the idea for you. ill try to logicaly code it here.

Code:
public pfn_touch(ptr,ptd) {     if(ptr == 0 || ptd == 0) // if world     {         return PLUGIN_CONTINUE // kill touch     }     else     {         if(is_user_alive(ptr) && is_user_alive(ptd))             set solidity             set_task(unset solidity after certain period of time)     } }

Sorry I kinda just did it real quick if you want a bigger explaination i can code it for you would only take me a few secs
__________________
Sig Under Construction.
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
Blitz
Senior Member
Join Date: Jul 2005
Location: Google
Old 08-18-2005 , 22:55  
Reply With Quote #10

Haha, that's exactly how I did it. I'm still testing for bugs.
__________________
[img]http://img268.**************/img268/7071/blitz4ek.jpg[/img]

In the beginning, God created the search button.
Blitz 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:27.


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