Raised This Month: $32 Target: $400
 8% 

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
FoxMulder
Senior Member
Join Date: Jan 2009
Location: Orlando, FL
Old 10-18-2009 , 19:08   Re: [EXTENSION] SDK Hooks
#11

Thanks man, in your example please update:
public OnTakeDamage(...) -> public Action:OnTakeDamage(...)

Will the following cause any problems, I currently have Dukehacks installed as well.

Code:
SourcePawn Compiler 1.2.4
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(31) : warning 201: redefinition of constant/macro (symbol "DMG_REMOVENORAGDOLL")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(33) : warning 201: redefinition of constant/macro (symbol "DMG_PHYSGUN")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(34) : warning 201: redefinition of constant/macro (symbol "DMG_PLASMA")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(35) : warning 201: redefinition of constant/macro (symbol "DMG_AIRBOAT")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(36) : warning 201: redefinition of constant/macro (symbol "DMG_DISSOLVE")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(37) : warning 201: redefinition of constant/macro (symbol "DMG_BLAST_SURFACE")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(38) : warning 201: redefinition of constant/macro (symbol "DMG_DIRECT")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(39) : warning 201: redefinition of constant/macro (symbol "DMG_BUCKSHOT")
Also can I hook enities other than clients like:
SDKHook(entity, SDKHook_OnTakeDamage, OnTakeDamage);
__________________

Last edited by FoxMulder; 10-18-2009 at 19:24.
FoxMulder is offline
DaFox
Senior Member
Join Date: Mar 2005
Old 10-18-2009 , 19:44   Re: [EXTENSION] SDK Hooks
#12

Quote:
Originally Posted by DJ Tsunami View Post
Looks like I put the blocking code in the Spawn hook instead of the SetTransmit hook. I'll fix it tomorrow.
While you're doing that; Add this, it should be simple enough for you. ;)

162 CBasePlayer::NetworkStateChanged_m_hGroundEnt ity(void*)
via
http://wiki.alliedmods.net/CCSPlayer...ike:_Source%29

The pointer points to the ground entity. doo it!
__________________
Quote:
Originally Posted by Peoples Army
your from Finland? what country is that in?
DaFox is offline
Someone78
Junior Member
Join Date: Mar 2009
Location: Russia
Old 10-18-2009 , 19:51   Re: [EXTENSION] SDK Hooks
#13

please add Weapon_CanUse
Someone78 is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 10-18-2009 , 20:09   Re: [EXTENSION] SDK Hooks
#14

It just means that he copy pasted the damage type defines out of the dukehacks include. I would probably suggest not to use them both together, but no this issue will not cause any problems.

*Sticked the thread

Quote:
Originally Posted by FoxMulder View Post
Thanks man, in your example please update:
public OnTakeDamage(...) -> public Action:OnTakeDamage(...)

Will the following cause any problems, I currently have Dukehacks installed as well.

Code:
SourcePawn Compiler 1.2.4
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(31) : warning 201: redefinition of constant/macro (symbol "DMG_REMOVENORAGDOLL")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(33) : warning 201: redefinition of constant/macro (symbol "DMG_PHYSGUN")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(34) : warning 201: redefinition of constant/macro (symbol "DMG_PLASMA")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(35) : warning 201: redefinition of constant/macro (symbol "DMG_AIRBOAT")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(36) : warning 201: redefinition of constant/macro (symbol "DMG_DISSOLVE")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(37) : warning 201: redefinition of constant/macro (symbol "DMG_BLAST_SURFACE")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(38) : warning 201: redefinition of constant/macro (symbol "DMG_DIRECT")
C:\TF2Server\orangebox\tf\addons\sourcemod\scripting\include\sdkhooks.inc(39) : warning 201: redefinition of constant/macro (symbol "DMG_BUCKSHOT")
Also can I hook enities other than clients like:
SDKHook(entity, SDKHook_OnTakeDamage, OnTakeDamage);
__________________
CrimsonGT is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 10-19-2009 , 05:12   Re: [EXTENSION] SDK Hooks
#15

Quote:
Originally Posted by FoxMulder View Post
Thanks man, in your example please update:
public OnTakeDamage(...) -> public Action:OnTakeDamage(...)
Yeah I saw that, will fix it in a bit too. And yes, DukeHacks uses the same defines, but I didn't think it would be a problem as long as you don't both include sdkhooks.inc and dukehacks.inc in one script.
Quote:
Also can I hook enities other than clients like:
SDKHook(entity, SDKHook_OnTakeDamage, OnTakeDamage);
Yes, I know I kind of poorly named the entity index "victim", implying it only works for clients, but OnTakeDamage works for all entities.
Quote:
Originally Posted by Someone78 View Post
please add Weapon_CanUse
Is there anything Weapon_CanUse does that one of the other weapon hooks can't do already? You can already block people from equipping a weapon with Weapon_Equip, and block them from switching to it with Weapon_Switch.
Quote:
Originally Posted by CrimsonGT View Post
*Sticked the thread
Love you long time

Edit: SetTransmit should be fixed now
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 10-19-2009 at 06:06.
DJ Tsunami is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 10-19-2009 , 11:35   Re: [EXTENSION] SDK Hooks
#16

Quote:
Edit: SetTransmit should be fixed now
Yes, it works! And this is very cool feature.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 10-19-2009 , 12:12   Re: [EXTENSION] SDK Hooks
#17

This looks fantastic!
__________________
Jindo is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 10-20-2009 , 07:11   Re: [EXTENSION] SDK Hooks
#18

Finally an extension that supports most of the game win/linux great

I got a question to the LevelInit hook:

  • What is the "String:mapEntities[]" parameter good for ? Does it contain the map entities created on mapstart ? How to use it ?
  • I think the parameters "char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background" what be also interesting to have in the hook.
And do you have examples what could be done with the SetTransmit() hook ? Why would I not let it send an entity to a player ?

Good work Greetz Berni
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 10-20-2009 , 10:57   Re: [EXTENSION] SDK Hooks
#19

Quote:
Originally Posted by berni View Post
What is the "String:mapEntities[]" parameter good for ? Does it contain the map entities created on mapstart ? How to use it ?
It's a string of the entities that are inside the BSP file. It's a very large string (technically up to 2MB, but usually below 500KB), so you'll need #pragma dynamic, and then explode on "\n" and read each line.

Quote:
I think the parameters "char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background" what be also interesting to have in the hook.
For some reason pOldLevel and pLandmarkName were always NULL, I don't know what loadGame is for, and I can't imagine any map on a dedicated server ever being a background, so it didn't seem useful to me to pass those too.

Quote:
And do you have examples what could be done with the SetTransmit() hook ? Why would I not let it send an entity to a player ?
Basically when you don't want a specific player to see that entity For example, when you parent an entity to someone's head, it floats in front of their view. With a SetTransmit hook you can hide it from the owner, while still allowing other players to see it.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 10-20-2009 , 17:35   Re: [EXTENSION] SDK Hooks
#20

I think loadGame is set to true when the server is starting up with the first map.

Sounds useful Thanks allot
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Closed Thread


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


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