Raised This Month: $ Target: $400
 0% 

Real bombsites count


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-21-2014 , 07:13   Re: Real bombsites count
Reply With Quote #1

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 Array:targetsList = ArrayCreate(); for (new i, target; i < entitiesCount; ++i) {     target = pev(entitiesList[i], pev_target);     ArrayFindValue(targetsList, target) == -1 && ArrayPushCell(targetsList, target); } new bombSitesCount = ArraySize(targetsList); ArrayDestroy(targetsList); log_amx("Bomb site count = %d", bombSitesCount);

Code:
[test.amxx] Bomb site count = 2
This is actually kinda dumb to do that, because well, most of time you have always only 2 bomb sites.
You will have to explain what you want to do exactly. It would make more sense, for example, to store each zone origin and associating each zone with a bomb site number (generally you have only 2 bomb site, but it can be more).
__________________

Last edited by Arkshine; 11-21-2014 at 07:22.
Arkshine 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 17:39.


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