Raised This Month: $51 Target: $400
 12% 

Real bombsites count


Post New Thread Reply   
 
Thread Tools Display Modes
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 11-21-2014 , 12:04   Re: Real bombsites count
Reply With Quote #11

Quote:
Originally Posted by Arkshine View Post
Ah misread. Anyway, tried with get_brush_entity_origin() and it works fine for me. So debug your code.
Your code is on de_torn map:

Bomb site count = 4


How to fix my last code?
__________________
kiki33hun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-21-2014 , 12:07   Re: Real bombsites count
Reply With Quote #12

Yeah, it's because I thought getting string as integer would give the same pointer:

Code:
new entitiesList[12]; new entitiesCount; entitiesCount  = find_sphere_class(0, "func_bomb_target", 4096.0, entitiesList, sizeof entitiesList); entitiesCount += find_sphere_class(0, "info_bomb_target", 4096.0, entitiesList[entitiesCount], sizeof entitiesList - entitiesCount); new Trie:targetsList = TrieCreate(); for (new i, entity, targetName[32], Float:origin[3]; i < entitiesCount; ++i) {     entity = entitiesList[i];         pev(entity, pev_target, targetName, charsmax(targetName));     !TrieKeyExists(targetsList, targetName) && TrieSetCell(targetsList, targetName, true);     get_brush_entity_origin(entity, origin);     server_print("Found %s (%d) : %f %f %f", targetName, entity, origin[0], origin[1], origin[2]); }     new bombSitesCount = TrieGetSize(targetsList); TrieDestroy(targetsList);     log_amx("Bomb site count = %d", bombSitesCount);

Code:
Found squarebreak (29) : 660.000000 -308.000000 -228.000000
Found templebreak (31) : -2064.000000 -100.000000 -408.000000
Found squarebreak (280) : 988.000000 -444.000000 -228.000000
Found squarebreak (281) : 1088.000000 -308.000000 -228.000000
Bomb site count = 2
__________________

Last edited by Arkshine; 11-21-2014 at 12:08.
Arkshine is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 11-21-2014 , 12:17   Re: Real bombsites count
Reply With Quote #13

Now working. Thank you Arkshine!!
__________________
kiki33hun is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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