Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
// old tfc_i386.so (2012): 12
// new tfc.so (2013): 16
#define linux_diff 12
public plugin_init()
{
register_plugin("pdata test", "1.4", "pizzahut")
register_clcmd("say test", "say_test")
}
public say_test(id)
{
static tele_id, tele_owner, tele_type
client_print(id, print_chat, "Check console")
tele_id = -1
while (tele_id = find_ent_by_class(tele_id, "building_teleporter"))
{
client_print(id, print_console, "tele id: %d", tele_id)
tele_owner = get_pdata_ent(tele_id, 332, linux_diff)
if (is_valid_ent(tele_owner))
client_print(id, print_console, "owner id: %d", tele_owner)
tele_type = get_pdata_int(tele_id, 427)
switch (tele_type)
{
case 4: client_print(id, print_console, "type: entrance")
case 5: client_print(id, print_console, "type: exit")
}
}
return PLUGIN_HANDLED
}