whoa, slow down.. not so many responses at once... lmao
Anyways, here is where I am at now... I DID get some flags to change models, but some did not, and with changing them it seemed to have "killed" the capture areas...
I added a bit of "developer" code to show information on the objectives before and after the change.. the output from this has me baffled...
Would someone knowledgable in DOD look this over and try this code out (replace christmas tree models with something you have on hand, the model itself makes no differenc, I just want them to change with a plugin)
Code:
#include <amxmodx>
#include <dodfun>
#define PLUGIN "dod_christmas_trees"
#define VERSION "76.0"
#define AUTHOR "TatsuSaisei"
new CHRISTMAS_TREE_NEUTRAL[] = "models/christmas_neutral.mdl"
new CHRISTMAS_TREE_AXIS[] = "models/christmas_axis.mdl"
new CHRISTMAS_TREE_ALLIES[] = "models/christmas_allies.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("fixup","fixup",ADMIN_RCON,"= Fix flags...")
register_event("SetObj","flags2trees","a")
}
public flags2trees()
{
new maxobj = objectives_get_num()
for(new i=0; i<maxobj; i++)
{
objective_set_data( i, CP_model_body_neutral , 0 )
objective_set_data( i, CP_model_body_axis , 0)
objective_set_data( i, CP_model_body_allies , 0 )
objective_set_data( i, CP_model_neutral , 0,CHRISTMAS_TREE_NEUTRAL )
objective_set_data( i, CP_model_axis , 0,CHRISTMAS_TREE_AXIS )
objective_set_data( i, CP_model_allies , 0,CHRISTMAS_TREE_ALLIES )
}
objectives_reinit()
return PLUGIN_CONTINUE
}
public fixup(id,level,cid)
{
new maxobj = objectives_get_num()
client_print(id,print_chat,"Objects: %d",maxobj)
for(new i=0; i<maxobj; i++)
{
new string[64]
objective_get_data(i,CP_model_neutral,string,64)
client_print(id,print_chat,"Neutral %s",string)
objective_get_data(i,CP_model_axis,string,64)
client_print(id,print_chat,"Axis %s",string)
objective_get_data(i,CP_model_allies,string,64)
client_print(id,print_chat,"Allies %s",string)
client_print(id,print_chat,"Iteration %d",i)
}
return PLUGIN_CONTINUE
}