oscar-broman / samp-weapon-config

A more consistent and responsive damage system with many new features
Apache License 2.0
92 stars 85 forks source link

redefinition of constant/macro (symbol "SetPlayerHealth") #184

Closed TerzicScript closed 3 years ago

TerzicScript commented 3 years ago

Just added weapon-config and SKY to my script, and there are 2 warnings :

\include\weapon-config.inc(5799) : warning 201: redefinition of constant/macro (symbol "SetPlayerHealth") \include\weapon-config.inc(5823) : warning 201: redefinition of constant/macro (symbol "SetPlayerArmour")

Also, line of code in weapon-config is :

`#if defined _ALS_SetPlayerHealth

undef SetPlayerHealth

else

#define _ALS_SetPlayerHealth

endif

define SetPlayerHealth WC_SetPlayerHealth //this one

if defined _ALS_SetPlayerArmour

#undef SetPlayerArmour

else

#define _ALS_SetPlayerArmour

endif

define SetPlayerArmour WC_SetPlayerArmour //this one`

I should also say that everything works normally, like setting hp with command, setting armor, falling and losing hp etc..

TerzicScript commented 3 years ago

Problem was with OnPlayerShootPlayer include which also defined SetPlayerHealth...

Y-Less commented 3 years ago

Which means that that include isn't using ALS correctly. ALS is designed to allow different includes to work together without causing these conflicts. weapon-config does it correctly, as you can see from the code you posted, which means you need to open an issue on the other library to tell them about the problem.