[TUT] Semiclip

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Re: [TUT] Semiclip

Post by Archive-Poster »

Using Engine and register_think would make it much much faster, but everyone goes all bitchy when you use Engine instead of Fakemeta to do stuff so I avoided it.
Hum, why is engine fastest than fakemeta?
It isn't in general, just in this case. FM_Think is called for every ent in every plugin that registers it. Engine uses the generally better method of sorting out which classnames should be filtered out and only calling the forwards for the plugins which asked for those.
Oh, like in hamsandwich ?
Hmm I thought it was the same thing, only less work on your side.
Guess I should start using hamsandwich for that too, if it's actually more efficient...
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Re: [TUT] Semiclip

Post by Archive-Poster »

Hi I just have an idea but I am no coder.
I have a gungame server and just want the noclip for teammates only. And
I found something on this site that works ok but I see that people abuse the fact that there is no hit box if 2 teammates stand together. So I though maybe there is a way (like I said I'm no coder) that will slay you if you sit inside the noclip zone for more then 2 or 3 sec. I don't even know if this is possible, but if this could be done that would be nice.
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Re: [TUT] Semiclip

Post by Archive-Poster »

By the way, your engine example of the first method doesn't work either.
I think it may be a blanket problem for all touches that it doesn't work anymore. It used to the first time I used it. Maybe an engine update or something.
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Re: [TUT] Semiclip

Post by Archive-Poster »

Oh, like in hamsandwich ?
Not quite, it's too offtopic to explain in dirty details, but the gist of it is hamsandwich doesn't do the classname lookup so it is faster, but it is not possible to create your own classname for the Ham_Think hook. You need to piggy back off of whatever you base your custom entities off of (typically people use 'info_target') and check the classname there.
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Re: [TUT] Semiclip

Post by Archive-Poster »

Code: Select all

#include <amxmodx>
#include <engine>

public plugin_init()
{
    register_plugin("Semiclip Test 1","1.0","Hawk552")
   
    register_touch("player","player","TouchPlayer")
}

public TouchPlayer(/*Ptr,Ptd*/)
    return PLUGIN_HANDLED
This looks pretty nice and easy (of course you'd have to add more like cvar checks and such), but there's one catch: it really doesn't do what you want it to. Because of client prediction, the player gets stopped first and then passes through. If you're using this on the ground it's really not a big deal (although kind of annoying), but when you're using it for something like surfing (like I am), it becomes a big problem.
This would be the perfect solution for me. Sadly it doesn't work. Can anyonne confirm this?
Yes.
But why is it listed here? I don't care if it was buggy like described.
But it doesn't seem to work AT ALL. I see no change in collision behaviour whatsoever. Was there an update from valve or something? I don't really understand. :S
Try with return FMRES_SUPERCEDE or try ot's one.

Code: Select all

public TouchPlayer(Ptr,Ptd)
    return FMRES_SUPERCEDE
User avatar
Archive-Poster
Posts: 1229
Gender:
United States of America

Re: [TUT] Semiclip

Post by Archive-Poster »

I tried both and they have NO EFFECT. I think one of valves updates broke it.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests