Well your code doesn't work because entity class name "obj_teleporter_entrance" and "obj_teleporter_exit" does not exist. I don't know where you got those, but that's wrong.
You have to use
TF2_GetObjectMode with the
TFObjectMode enum to know if a teleporter is an exit or entrance teleporter.
Code:
public void OnPluginStart()
{
HookEvent("player_builtobject", Event_Player_BuiltObject);
}
public Action Event_Player_BuiltObject(Event event, const char[] sEventName, bool bDontBroadCast)
{
int iTeleporter = event.GetInt("index");
if (iTeleporter > MaxClients)
{
if (TF2_GetObjectMode(iTeleporter) == TFObjectMode_Entrance)
{
//your code goes here
}
}
}
I also moved your code to new syntax, and I encourage you using it, since in the near future, support for it will be dropped, or well some sourcemod functions will only be available through methodmaps.
__________________