AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   NS Auto-comm (https://forums.alliedmods.net/showthread.php?t=9372)

JPiolho 01-16-2005 17:43

NS Auto-comm
 
I am trying do a automatic commander to marines, is going fine but I have a little problem, when a player get nearby a resource node a resource tower is created, after 1 sec other resource tower is created and the 2 resources towers are killed because a command I created, but I only want know how to check if the node have already 1 resource tower

I spend 3 hours trying to fix, but nothing

plz help-me :D

XxAvalanchexX 01-16-2005 18:45

Try using find_ent_in_sphere or find_sphere_class to check for nearby resource tower entities.

JPiolho 01-17-2005 15:54

find_ent_in_sphere ( StartEntity, Float:origin[3], Float:radius )

what StartEntity means?

XxAvalanchexX 01-17-2005 20:39

StartEntity is an offset to start searching from (+1), so you can create a loop to find all of the entities like this:

Code:
new ent; while((ent = find_ent_in_sphere(ent,origin,radius)) != 0) {  // ent would be the current entity }

This will reassign a value to ent each time through and make sure not to search through what it has already searched, and it will stop the loop if you can't find any more entities passed the offset.

JPiolho 02-05-2005 05:42

Is there any way to change or check marine resources?

XxAvalanchexX 02-05-2005 12:24

ns_get_res might be able to grab Marine resources, but I don't think ns_set_res will let you set it.


All times are GMT -4. The time now is 19:21.

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