entity purge howto
Hi,
i'm interested in periodical purging of dropped weapons (esp. USP & scouts). Code:
It makes server failing cca. every half an hour. Is this a right way to do this? And i'm not sure, whether it's right, do distinguish dropped weapons from those carried by EV_INT_movetype flag. Could you help me? Thank you. Al. |
A. [ small ] tags por favor
B. Code:
|
I'm sorry, but it just do the same as:
Code:
I have no problem with purging weaponboxes, but weapon_* entities. Those can be also carried by players or dropped. They have no model! I need to distinguish weapo_* being carried and dropped one. But thank you ... |
What do you think about this:
Code:
|
Use find_entity_by_class like so:
Code:
|
Is it ok to have one loop for each entity i would like to kill? I'm just asking ...
Thanks. And btw, i'm not sure, whether it's correct to start with entid = 32 ... i made small entity listing command and noticed typical entities with id < 32. I think, it depends on player limit. And what about weapon_bla entities? Do I have to code 1 loop for each of them? I think, it's not a solution :( |
Ok, then start with -1. Use the code I've provided.
|
Max entities global should be used instead of entity_count
weaponbox also "contain" weapon_* entity which should be removed too in other case here is a chance of edict overflow. Should be: for (new i = get_maxplayers() + 1 ... Should be: while((ent = find_ent_by_class... Here is the correct way: Code:
|
Works fine now!!! Thank you!!!
|
| All times are GMT -4. The time now is 05:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.