View Single Post
psychonic

BAFFLED
Join Date: May 2008
Old 06-11-2012 , 07:17   Re: Access SourceMod core?
Reply With Quote #4

Quote:
Originally Posted by ajr1234 View Post
Thanks. Makes sense now. Short and simple

Is there an easy way to hook client connect, disconnect, map start, player move, etc? I'm making an extension where certain information is added to a stack every time these actions take place. I would do that in a plugin, but I need an external library to do calculations, and the library isn't opensource so I am not able to make a wrapper.

What does this mean anyway?
SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, edict_t *);

I know it's a sourcehook, but how would someone know what kind of macro to use? I looked through the extensions forum but I am not sure how people are finding out how to form their hooks.
For client connect and disconnect as well as map start (OnServerActivated), you can use the IClientListener interface in IPlayerHelpers.h. (add yourself with playerhelpers->AddClientListener, and don't forget to remove on unload).

For movement, I'm not sure offhand what the best way to check would be (other than checking position each frame).
psychonic is offline