Raised This Month: $ Target: $400
 0% 

How do i fix these errors and a warning?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-09-2021 , 07:50   Re: How do i fix these errors and a warning?
Reply With Quote #1

You are misapplying a native as a function header and function header as a native. Radiusdamage cannot be the name of a function and the name of a native. Use another name. Replace radiusdamage with something else, unique.

Code:
RadiusDamage(Float:vecSrc[3], pevInflictor, pevAttacker, Float:flDamage, Float:flRadius, bitsDamageType)
==>
Code:
TheRadiusDamage(Float:vecSrc[3], pevInflictor, pevAttacker, Float:flDamage, Float:flRadius, bitsDamageType)
API is www.amxmodx.org/api/

One can type radiusdmage and it is a native in the api. You are using a native as a name of a function. Can not do that.

I erased the part about the consequences of the native radiusdamage as that is not what you were really trying to use. It hoses the client. It can be fixed but it's more code and not worth the effort as it will always be buggy.
__________________

Last edited by DJEarthQuake; 12-09-2021 at 10:17. Reason: updating
DJEarthQuake is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 12-09-2021 , 14:26   Re: How do i fix these errors and a warning?
Reply With Quote #2

Quote:
Originally Posted by DJEarthQuake View Post
You are misapplying a native as a function header and function header as a native. Radiusdamage cannot be the name of a function and the name of a native. Use another name. Replace radiusdamage with something else, unique.

Code:
RadiusDamage(Float:vecSrc[3], pevInflictor, pevAttacker, Float:flDamage, Float:flRadius, bitsDamageType)
==>
Code:
TheRadiusDamage(Float:vecSrc[3], pevInflictor, pevAttacker, Float:flDamage, Float:flRadius, bitsDamageType)
API is www.amxmodx.org/api/

One can type radiusdmage and it is a native in the api. You are using a native as a name of a function. Can not do that.

I erased the part about the consequences of the native radiusdamage as that is not what you were really trying to use. It hoses the client. It can be fixed but it's more code and not worth the effort as it will always be buggy.
When I replaced the old line with the new line you gave me, I got 2 errors, but I fixed them by myself. Now, the plugin works. Adding "The" (or anything else that makes "RadiusDamage" unique) fixed the problem, and eliminated the rest of the errors (and the warning) I mentioned in my first post.

Thanks.
GlobalPlague is offline
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 11:44.


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