Alright, I 'think' I did what you said, but it still spawns us all at (0 0 0) and the entity doesn't work that was suppose to be made
.
Code:
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
new ent = find_ent_by_class(-1, "info_tfdetect");
if(ent)
{
remove_entity_name("info_tfdetect");
}
new ent2 = create_entity("info_tfdetect");
entity_set_string(ent2, EV_SZ_classname, "info_tfdetect");
DispatchKeyValue(ent2, "origin", "0 0 0");
DispatchKeyValue(ent2, "maxammo_shells", "1006");
DispatchKeyValue(ent2, "team1_name", "SuRf3rs!");
DispatchKeyValue(ent2, "hook_out", "0");
DispatchKeyValue(ent2, "ex_skill_max", "3");
DispatchKeyValue(ent2, "ex_skill_min", "1");
}
public plugin_precache()
{
register_forward(FM_KeyValue, "forward_keyvalue");
}
public forward_keyvalue(ent2, kvdid) {
if(!pev_valid(ent2)) {
return FMRES_IGNORED;
}
new keyname[128];
get_kvd(kvdid, KV_KeyName, keyname, 127);
if(equal(keyname, "origin"))
{
set_kvd(kvdid, KV_Value, "0 0 0");
}
else if(equal(keyname, "maxammo_shells"))
{
set_kvd(kvdid, KV_Value, "1006");
}
else if(equal(keyname, "team1_name"))
{
set_kvd(kvdid, KV_Value, "SuRf3rs!");
}
else if(equal(keyname, "hook_out"))
{
set_kvd(kvdid, KV_Value, "0");
}
else if(equal(keyname, "ex_skill_max"))
{
set_kvd(kvdid, KV_Value, "3");
}
else if(equal(keyname, "ex_skill_min"))
{
set_kvd(kvdid, KV_Value, "1");
}
return FMRES_IGNORED // at the end of function
}