AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   NS Plugin - Number of active RT's - Need offset (https://forums.alliedmods.net/showthread.php?t=13036)

Ebag333 05-02-2005 03:45

NS Plugin - Number of active RT's - Need offset
 
OK, I have the following code. The problem is that with the way the code is now, it gets broken with whichbot, or if a player 'tricks' it. Apparently (and I'm just guessing here) if an RT build fails, it still counts for get_build("alienresourcetower", 0).

Anyone know (or know how to get) the offset for this? The old offset was 27 (PRIVATE_ACTIVE_RES).


Code:

get_num_active_rt() {

//Poor mans hack to get number of RTs.
//gets all rts that have been attempted to be built
//so it breaks with WhichBot and if an RT build fails.
new num = get_build("alienresourcetower", 0)

/* REMOVED DUE TO BAD OFFSET.
new num
new numrt = get_build("alienresourcetower", 0)
for (new i = 1; i <= numrt; ++i) {
 new id = get_build("alienresourcetower", i)
 if ( get_private_i(id, PRIVATE_ACTIVE_RES, 4) ) // Resource towers have an activation time of about 5 secs after
  num++    // they are built before they start giving res out.
}
*/
return num
}



All times are GMT -4. The time now is 16:47.

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