Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 07-05-2006 , 12:28   Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #1

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
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Zenith77
Veteran Member
Join Date: Aug 2005
Old 07-05-2006 , 12:38   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #2

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.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 07-05-2006 , 12:43   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #3

Both are included (dod and CS includes).... So it would only hit the first if statement...
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Zenith77
Veteran Member
Join Date: Aug 2005
Old 07-05-2006 , 12:45   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #4

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.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred

Last edited by Zenith77; 07-05-2006 at 12:56.
Zenith77 is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 07-05-2006 , 13:32   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #5

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
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 07-05-2006 , 13:46   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #6

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?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 07-05-2006 , 13:51   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #7

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-05-2006 , 17:57   Re: Attemping to use 2 forwards (with same name) in plugin
Reply With Quote #8

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.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
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 07:58.


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