Raised This Month: $ Target: $400
 0% 

This doesn't work: create_entity(const name[])


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 01-19-2007 , 16:17   This doesn't work: create_entity(const name[])
Reply With Quote #1

This works:
Code:
#include <amxmodx> #include <engine> #define DEFINED_CLASSNAME "info_target" public some_function() {     create_entity(DEFINED_CLASSNAME) }

This gives me an error: "Error: Argument type mismatch (argument 1) on line 8"

Code:
#include <amxmodx> #include <engine> new const const_classname[] = "info_target" public some_function() {     create_entity(const_classname) }

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.)
stupok is offline
 


Thread Tools
Display Modes

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 22:21.


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