Raised This Month: $ Target: $400
 0% 

Using #define to set command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-12-2013 , 13:15   Re: Using #define to set command
Reply With Quote #1

Quote:
Originally Posted by Kia View Post
1. There is a space, maybe wasn't copied correctly.
2. Why not?
3. I dont want to Hook Say for that, isn't a possible to use register_clcmd?

Sorry, I went full retard, didn't check the log. -_-


Working now.

PHP Code:
new const szSayCommandSlash[]     = "say /pmodel"
new const szSayCommand[]         = "say pmodel"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd(szSayCommand        ,"Test")
    
register_clcmd(szSayCommandSlash,"Test")
}

public 
Test(id)
{
    
user_kill(id)

why would you use arrays for registring it as a command? It's easier to put the string into your register_clcmd() instead of creating an array (this will save CPU)
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 05-12-2013 , 13:27   Re: Using #define to set command
Reply With Quote #2

Quote:
Originally Posted by Napoleon_be View Post
(this will save CPU)
Won't it save Memory instead of CPU? Or I'm wrong?
didoWEE 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 16:20.


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