This doesn't work: create_entity(const name[])
This works:
Code:
This gives me an error: "Error: Argument type mismatch (argument 1) on line 8" Code:
I want to use a constant instead of a define. According to the optimization AMWiki, it's a better choice. This problem doesn't exist in the fakemeta equivalent of this function, however. Any ideas? (Besides switching to fakemeta.) |
Re: This doesn't work: create_entity(const name[])
This compiled with 0 Errors, 0 Warnings. Don't know if you would want to use it though.
Code:
|
Re: This doesn't work: create_entity(const name[])
Could you explain the difference between declaring const_classname[] with "static" vs. "new"?
|
Re: This doesn't work: create_entity(const name[])
http://wiki.amxmodx.org/index.php/Op...atic_vs_Global
Quote:
|
Re: This doesn't work: create_entity(const name[])
Look at the prototype:
native create_entity(szClassname[]); It's not a native create_entity(const szClassname[]); That is why you should not use const keyword for your global. Just omit it in your example. Using static has no sense here because of a global scope. AFAIK, global static vars are used to deny amx/x engine to access this var. It's hard to imagine for me an example when it's vital to use static declaration in global scope. |
Re: This doesn't work: create_entity(const name[])
FYI we have a report for such issues: [*.inc] Unable to pass a constant arrays to some of the functions
|
| All times are GMT -4. The time now is 22:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.