this wouldn't be hard at all to do. Here, I'll script this out, sigh
Code:
stock find_bomb_targets(Float:location1[3],Float:location2[3])
{
new ent1=find_ent_by_class(32,"bomb_target")
new ent2=find_ent_by_class(ent1,"bomb_target")
entity_get_vec(ent1,EV_VEC_origin,location1)
entity_get_vec(ent2,EV_VEC_origin,location2)
return PLUGIN_CONTINUE
}
put that into your script and use this example to find the original bomb site locations.
Code:
new Float:bombsite_location1[3]
new Float:bombsite_location2[3]
find_bomb_targets(bombsite_location1,bombsite_location2)
and to move the bomb sites put this at the end of your script:
Code:
//Max number of new bombsites a player can create:
#define MAX_BOMBSITES 3
//Global Variables:
new bombsites_num=0
new Float:bombsite_location[MAX_BOMBSITES][3]
new Float:bombsite_radius[MAX_BOMBSITES]
stock handle_bombsites()
{
for(new i1=1;i1<=32;i1++)
{
ifis_user_alive(i1))
{
cs_set_user_plant(i1,0)
}
}
for(new i=0;i<=bomsites_num - 1;i++)
{
find_ent_in_sphere(0,bombsite_location[i],bombsite_radius[i])
while(ent<=32 && ent)
{
if(is_user_alive(ent))
{
cs_set_user_plant(i1,1)
}
}
}
return PLUGIN_CONTINUE
}
And call that function every second or 2 with this in plugin_init:
Code:
set_task(2.0,"handle_bombsites",0,"",0,"b")
And then to fill in those global variables, make a command like this:
Code:
//in plugin_init
register_concmd("amx_fake_bombsite","make_fake_bombsite",ADMIN_LEVEL_HERE,"Makes a fake bombsite at a player's location: <nick> <size>")
register_concmd("amx_delete_fake_bombsite","delete_fake_bombsite",ADMIN_LEVEL_HERE,"Deletes a fake bombsite that you've already made: <#num or all>")
//not in plugin_init
public make_fake_bombsite(id,level,cid)
{
if(!cmd_access(id,level,cid,3))
{
return PLUGIN_HANDLED
}
new arg1[32]
new target = cmd_target(id,arg1,4)
if(!target)
{
return PLUGIN_HANDLED
}
if(bombsites_num>=MAX_BOMBSITES)
{
console_print(id,"[AMXX] Max bomsites (MAX_BOMBSITES) have already been made. Delete some fake bombsites first.")
return PLUGIN_HANDLED
}
entity_get_vector(target,EV_VEC_origin,bombsite_location[bombsites_num])
new arg2[32]
read_argv(2,arg2,31)
bombsite_radius[bombsites_num]=100*str_to_float(arg2)
bombsites_num++
return PLUGIN_HANDLED
}
make up your own delete bombsite command handler function.
make CVARs etc to your pleasure.
Requires Cstrike and Engine modules.