AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting Map Entities (https://forums.alliedmods.net/showthread.php?t=83634)

shine771 01-12-2009 16:28

Getting Map Entities
 
I made a map, with custom entities. Compiled fine. I want to find those entities with amxx and get origin and keyvalues. Seems like i can't find those entities... i tried:

PHP Code:

new ent=-1,n
while((ent=engfunc(EngFunc_FindEntityByString,ent,"classname","my_classname")) != && MAX_FLAGS+1
   
n++
        
log_amx("n=%d",n

n returned 0
I also tried registering FM_Spawn forward in precache and unregistering it on plugin_init.. it logged all entities except mine... I tried with FM_KeyValue.. the same. All except mine. I decompiled the map and still those entities were there. Strange? Any ideas?

ConnorMcLeod 01-12-2009 16:34

Re: Getting Map Entities
 
Load shptools on your map ( http://forums.space-headed.net/viewtopic.php?t=111 ) , type listent in console and see yours ents.
For keyvalue, hook FM_SetKevalue (with shptools), see listapi, hook_api, and restart the map.

shine771 01-13-2009 09:09

Re: Getting Map Entities
 
Hmm.. doesn't show up. Seems like it's a map problem... :/.

Arkshine 01-13-2009 09:53

Re: Getting Map Entities
 
Is it possible to get the map, shine771 ?

[edit] Thanks.

Arkshine 01-13-2009 14:48

Re: Getting Map Entities
 
Weird, indeed. I've tried without success, though there is a way. Using Engine and pfn_keyvalue, it works... Don't know why it doesn't work via fakemeta. :/

shine771 01-14-2009 16:40

Re: Getting Map Entities
 
I'm making a mod.. and i don't want to include engine just because of 1-2 lines... stupid.. :/.
EDIT: about pfn_keyvalue, yea i saw that in soccerjam. Was wondering how the author got it to work...

shine771 01-25-2009 09:14

Re: Getting Map Entities
 
bumpy... i really need this.. :S...


All times are GMT -4. The time now is 01:43.

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