Raised This Month: $ Target: $400
 0% 

Question about register_plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 08-08-2018 , 18:05   Re: Question about register_plugin
Reply With Quote #1

new const means initialize variables that will never be changed, this mean, keep with a permanent value, then, let's suppose you will create 40 entities with classname info_target. To not occupy much memory I believe it would be best to create a variable with the string info_target instead of define each one.


Code:

new const g_pszNameInfoTarget[] = "info_target";

something()
{
	create_entity(g_pszNameInfoTarget);
	create_entity(g_pszNameInfoTarget);
	create_entity(g_pszNameInfoTarget);
	create_entity(g_pszNameInfoTarget);
	create_entity(g_pszNameInfoTarget);
}
instead of

Code:
something()
{
	create_entity("info_target");
	create_entity("info_target");
	create_entity("info_target");
	create_entity("info_target");
	create_entity("info_target");
}
__________________









Last edited by CrazY.; 08-08-2018 at 18:07.
CrazY. 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 12:49.


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