Quote:
Originally Posted by Craxor
The entity or whatever is the "speed band on deathrun zones"you know the speed band from deathrum mode that terorist have .
I've used FM_touch to find out its Entity ClassName, and it printed as being func_conveyor and the portal as trigger_teleport , i've tried to block them with register_touch() on trigger_teleport it worked perfectly but func_conveyor doesn't work .
I'll try to make some tests to see if it working (my goal is to block them when the DUEL is on so the players wont use it in duels ) .
Edit: Isn't there a way just to block touching it? I mean even if you touch you wont gain speed or anything ?
|
Looking at your code from 1st post I thought you want to block it forever.
Then you can make it like this:
PHP Code:
// I will stand by my opinion until get other way to block it
#include <everything_you_need>
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()
}
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)
}
public plugin_end()
{
ArrayDestroy(g_conveyorEnts)
}
public execute_me_on_duel_start()
{
// on duel start, loop through every registered entity and move it outside of the map
for(new i; i < ArraySize(g_conveyorEnts); i++)
{
entity_set_vector(i, EV_VEC_origin, outside_map)
}
}
public execute_me_on_duel_end_or_new_round()
{
// on duel end, loop through every registered entity and move it back
for(new i; i < ArraySize(g_conveyorEnts); i++)
{
entity_set_vector(i, EV_VEC_origin, back_to_map)
}
}
__________________