Raised This Month: $ Target: $400
 0% 

Using #define to set command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-12-2013 , 11:07   Using #define to set command
Reply With Quote #1

Hello everybody,

I have this code here :

PHP Code:
#define SAY_COMMAND_INV    pmodel

new szSayCommandSlash[64],szSayCommand[64]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
formatex(szSayCommand,charsmax(szSayCommand) - 1,            "say %s",    SAY_COMMAND_INV)
    
formatex(szSayCommandSlash,charsmax(szSayCommandSlash) - 1,    "say /%s",    SAY_COMMAND_INV)
    
    
register_clcmd(szSayCommand,"Test")
    
register_clcmd(szSayCommandSlash,"Test")

But I get this error :
Quote:
I:\AMXXdev\PStudio\temp682.sma(32) : error 017: undefined symbol "pmodel"
If I set
PHP Code:
#define SAY_COMMAND_INV    pmodel 
to
PHP Code:
#define SAY_COMMAND_INV    "pmodel" 
the command isn't working ingame.

Anyone knows how to solve that?
__________________

Last edited by Kia; 05-12-2013 at 11:07.
Kia is offline
 



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 16:20.


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