So I m trying to spawn working func_nav_prerequisite I have already filled all reqiured stuff such as keyvalues and added filter
Anyone had luck spawning it and get it to work?
Anyway heres the code so far
PHP Code:
public Action:Command_spawnhint(client, args)
{
new Filter = CreateEntityByName("filter_activator_tfteam");
//DispatchKeyValue(Filter, "filtertype", "1");
DispatchKeyValue(Filter, "Negated", "Allow entities that match criteria");
DispatchKeyValue(Filter, "TeamNum", "0");
DispatchKeyValue(Filter, "targetname", "filter_moveto");
DispatchSpawn(Filter);
new Float:playerpos[3];
GetEntPropVector(client, Prop_Send, "m_vecOrigin", playerpos);
new entindex = CreateEntityByName("func_nav_prerequisite");
if (entindex != -1) //dispatch ent properites
{
DispatchKeyValue(entindex, "filtername", "filter_moveto"); //correct
DispatchKeyValue(entindex, "Task", "2"); //move to task correct
DispatchKeyValue(entindex, "spawnflags", "1"); //clients only
DispatchKeyValue(entindex, "Entity", "gate1_prerequisite_door");//mvtd //realy a ent name
DispatchKeyValue(entindex, "Value", "0"); //correct
//DispatchKeyValue(entindex, "spawnflags", "64");
DispatchKeyValue(entindex, "teamnum", "0");
}
DispatchSpawn(entindex);
SetEntPropEnt(entindex, Prop_Data, "m_hFilter", Filter); //correct
ActivateEntity(entindex);
AcceptEntityInput( entindex, "Enable" );
TeleportEntity(entindex, playerpos, NULL_VECTOR, NULL_VECTOR);
PrecacheModel("models/player/items/pyro/drg_pyro_fueltank.mdl");
SetEntityModel(entindex, "models/player/items/pyro/drg_pyro_fueltank.mdl");
new Float:minbounds[3] = {-100.0, -100.0, 0.0};
new Float:maxbounds[3] = {100.0, 100.0, 200.0};
SetEntPropVector(entindex, Prop_Send, "m_vecMins", minbounds);
SetEntPropVector(entindex, Prop_Send, "m_vecMaxs", maxbounds);
SetEntProp(entindex, Prop_Send, "m_nSolidType", 2);
new enteffects = GetEntProp(entindex, Prop_Send, "m_fEffects");
enteffects |= 32;
SetEntProp(entindex, Prop_Send, "m_fEffects", enteffects);
PrintToChatAll("Created the func_nav_prerequisite");
return Plugin_Handled;
}
__________________