`Natsh, trigger_push has no effect.
`kww , your code gives some tag mismatch warning when compile, also, i tried to add them into clcmd commands to check if they works, /remove block my cs or something like that, like teleporting my in a wall and blocks my screen view and when i use the add code with /add it teleports me somewhere else in a wall, test:
`JocANis, can you provide an scripting example?
PHP Code:
#include <amxmodx>
#include <engine>
new const EntityPlayerClass [] = "player";
new Array:g_conveyorEnts,
outside_map[3] = { -4096.0, -4096.0, -4096.0 },
back_to_map[3] = { 0.0, 0.0, 0.0 }
public plugin_init( )
{
register_touch( "trigger_teleport" , EntityPlayerClass , "player_touch" );
register_touch( "trigger_push" , EntityPlayerClass , "player_touch" );
register_clcmd( "say /remove", "rmv" );
register_clcmd( "say /add", "addx" );
register();
}
public rmv(id)
{
for(new i; i < ArraySize(g_conveyorEnts); i++)
{
entity_set_vector(i, EV_VEC_origin, outside_map)
}
}
public addx(id)
{
for(new i; i < ArraySize(g_conveyorEnts); i++)
{
entity_set_vector(i, EV_VEC_origin, back_to_map)
}
}
public plugin_end()
{
ArrayDestroy(g_conveyorEnts)
}
public register()
{
g_conveyorEnts = ArrayCreate(1)
new ent = -1
do {
ent = find_ent_by_class(ent, "func_conveyor")
if(is_valid_ent(ent)) // i forgor to check if it is valid
{
ArrayPushCell(g_conveyorEnts, ent) // if there are any entity, register it
}
}
while(ent)
}
__________________