What is the usage of IsValidEntity & IsValidEdict?
I see many plugins will use these two functions to check "something" before they actuallly do something. What is the use of these two functions? What is the differences?
|
Re: What is the usage of IsValidEntity & IsValidEdict?
Its use is to check if whatever index you have is valid or not. Means, if it is existing.
for example if you create a entity with an invalid classname and after that check it will return false so you can stop at this point to prevent errors. |
Re: What is the usage of IsValidEntity & IsValidEdict?
If you use RemoveEdict and some other functions on an invalid Entity index your server will crash.
The difference between Edict and Entity ... i'd use Edict because Entity sometimes returns "invalid Edict" ahaha |
Re: What is the usage of IsValidEntity & IsValidEdict?
Quote:
|
Re: What is the usage of IsValidEntity & IsValidEdict?
According to bailopans blog
Quote:
|
Re: What is the usage of IsValidEntity & IsValidEdict?
Quote:
|
Re: What is the usage of IsValidEntity & IsValidEdict?
This has actually changed since that blog post was written.
An entity is only understood by the game code, an edict is the engines representation of an entity (and used to network data about the entity to players). All edicts should have a matching entity, but some entities can exist without an edict. Logic style entities that don't have a client side entity won't have an edict, as they never get networked and exist purely for server side logic purposes. |
Re: What is the usage of IsValidEntity & IsValidEdict?
Then why can IsValidEntity return Invalid Edict, if it should be the other way around
|
Re: What is the usage of IsValidEntity & IsValidEdict?
Although I read this topic, but could not find a specific answer to the question.
You have to do this: PHP Code:
PHP Code:
PHP Code:
Give an example of proper and improper use of these functions :( |
All times are GMT -4. The time now is 19:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.