AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Attemping to use 2 forwards (with same name) in plugin (https://forums.alliedmods.net/showthread.php?t=40883)

Geesu 07-05-2006 12:28

Attemping to use 2 forwards (with same name) in plugin
 
Basically in dodx and csx there is a client_damage function...

Well war3ft is made so one compile works on DOD and CS, is there anyway I can implement the client_damage function for both? (there is a different number of arguments for each)

Thanks,
Josh

Zenith77 07-05-2006 12:38

Re: Attemping to use 2 forwards (with same name) in plugin
 
Code:
#if defined _cstrike_included public client_damage() //cs function { //code } #else public client_damage() //dod function { //code } #endif /*_cstrike_included*/

The include names may not be right though, check in cstrike.inc.

Geesu 07-05-2006 12:43

Re: Attemping to use 2 forwards (with same name) in plugin
 
Both are included (dod and CS includes).... So it would only hit the first if statement...

Zenith77 07-05-2006 12:45

Re: Attemping to use 2 forwards (with same name) in plugin
 
Well, how do you make it compile for different versions?

I imagine you have some other define like

Code:
#define CS_COMPILE_VERSION

If so, then just check for that. If not, well you can't overload functions in pawn so :/

Or, you could use fakemeta to hook traceline or register the DeathMsg event, and set up your own little system to work everything out, like attacker, victim, dmg, wpnid, etc.

Geesu 07-05-2006 13:32

Re: Attemping to use 2 forwards (with same name) in plugin
 
It doesn't compile for different versions... That is the point... One compile = works for DOD and it works for CS... I don't want to have to compile the plugin separately for DOD/CS... that's why i'm asking this question :P

Geesu 07-05-2006 13:46

Re: Attemping to use 2 forwards (with same name) in plugin
 
Well apparently in a newer version the client_damage is the same in CS/DOD, I hadn't checked recently...

But would be interesting to still know if there is a solution to this?

Hawk552 07-05-2006 13:51

Re: Attemping to use 2 forwards (with same name) in plugin
 
Quote:

Originally Posted by Geesu
Well apparently in a newer version the client_damage is the same in CS/DOD, I hadn't checked recently...

But would be interesting to still know if there is a solution to this?

Make a request that one gets renamed, or just hook Damage event for one of them.

jtp10181 07-05-2006 17:57

Re: Attemping to use 2 forwards (with same name) in plugin
 
thy dont need to be renamed, look at my gore plugin. http://forums.alliedmods.net/showthread.php?t=2039

I use those forwards for 4 mods at once, you dont need to do anything special. Except it might be a good idea to make sure the CSX or DoDX module is loaded like I did.


All times are GMT -4. The time now is 07:58.

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