AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   The better option for creating entity (https://forums.alliedmods.net/showthread.php?t=253058)

KiLLeR. 12-14-2014 11:34

The better option for creating entity
 
Who is the batter option?
PHP Code:

new ent create_entity("info_target");
// or
static ent;
ent create_entity("info_target"); 


fysiks 12-14-2014 12:26

Re: The better option for creating entity
 
The differences between the two snippets of code have nothing to do with creating an entity. And, clearly, you haven't tried both of them yet because one of them shouldn't even compile. Take a little time to search for information about the actual differences between the two pieces of code that you have posted.

KiLLeR. 12-14-2014 12:53

Re: The better option for creating entity
 
I tried both ways, but not found a difference.

YamiKaitou 12-14-2014 13:06

Re: The better option for creating entity
 
That is because there is no difference. Both options are calling the same function with the same parameters.

If your question is about static vs new (which is unrelated to createing entities), then search as there have been discussions about it before

KiLLeR. 12-14-2014 14:02

Re: The better option for creating entity
 
Quote:

Originally Posted by YamiKaitou (Post 2235306)
If your question is about static vs new (which is unrelated to createing entities), then search as there have been discussions about it before

Yes, my questions is about that.

fysiks 12-14-2014 14:20

Re: The better option for creating entity
 
Quote:

Originally Posted by YamiKaitou (Post 2235306)
then search as there have been discussions about it before


HamletEagle 12-15-2014 09:16

Re: The better option for creating entity
 
Also we have a tutorial somewhere on this forums.


All times are GMT -4. The time now is 15:32.

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