detect my entity model

Posted By: Carlos3DGS

detect my entity model - 05/12/10 15:21

is there any instruction to get the name of the model of an entity?

something like:

Quote:
action Car_Action()
{
STRING Model_Name;

Model_Name = What_Model_Does_This_Ent_Have(me);

if(Model_Name == "Car25.mdl")
{
do something...
}

}

void main()
{
ent_create("Car25.mdl",nullvector,Car_Action);
}


Is there any instruction that does something like that?
What_Model_Does_This_Entity_Have(ENTITY*);
Posted By: Superku

Re: detect my entity model - 05/12/10 16:21

str_for_entfile(string,entity)
Posted By: Aku_Aku

Re: detect my entity model - 05/12/10 17:34

Another tip:
Code:
// define the name string as a skill
#define objname	skill10
...
// create the entity and assign the name
entityname = ent_create(myfile, mypos, whatever);
entityname.objname=str_create("");
str_cpy((STRING*)entityname.objname,myfile);
...
// using the skill
if(str_cmpi((STRING*)entityname.objname,"Car25.mdl")==1) {
do something...
}


Naturaly, you can use your names etc.
Posted By: Carlos3DGS

Re: detect my entity model - 05/12/10 17:48

thanks! grin
© 2023 lite-C Forums