[HELP] Detect if Map has Water on Start
Is it possible to detect if a map has water at the start of a game so I can disable my plugin?
I saw this code that detects if there's a bombsite anywhere on the map: PHP Code:
PHP Code:
|
Re: [HELP] Detect if Map has Water on Start
PHP Code:
PHP Code:
|
Re: [HELP] Detect if Map has Water on Start
Like this?
PHP Code:
|
Re: [HELP] Detect if Map has Water on Start
This should do it, I will try it on my own plugin and I will tell you what happens.
PHP Code:
|
Re: [HELP] Detect if Map has Water on Start
This works:
PHP Code:
|
Re: [HELP] Detect if Map has Water on Start
I believe checking if an entity has classname "func_water" on pfn_spawn would be better. I am not sure if in this case it helps, but I had a plugin that removed bombsites/hostages with this method, because looping through each entity would be very slow.
|
Re: [HELP] Detect if Map has Water on Start
pfn_spawn, interesting. So it catches the entity as it is spawned and checks if it is func_water. Yes it sounds better than looping thru all of them after they've all loaded up.
So like this? PHP Code:
|
Re: [HELP] Detect if Map has Water on Start
Return PLUGIN_HANDLE, yes.
|
Re: [HELP] Detect if Map has Water on Start
For amxx >= 1.9 the best way is to use cs_find_ent_by_class. CS keeps track of entities using a hashtable which provides very fast lookup(it is faster than find_ent_by_class). This will not work if you search for entities you created with create_entity/fakemeta equivalent because the entities are not added to the hashtable. If this is the case, use cs_create_entity to create the entity.
|
Re: [HELP] Detect if Map has Water on Start
Like this?
PHP Code:
|
| All times are GMT -4. The time now is 16:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.