AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Blocking func_conveyor. (https://forums.alliedmods.net/showthread.php?t=337467)

Craxor 04-23-2022 07:22

Blocking func_conveyor.
 
Hi, i'm trying to make an plugin to block the SPEED BAND on deathrun maps and the teleporter .

I've succesfuly blocked the teleport portals, but the speed band is still working, i've tried with regsiter_touch and ham_Use and both doesn't work .

heres the code:

PHP Code:

#include <amxmodx>
#include <engine>
#include <hamsandwich>

new const EntityPlayerClass [] = "player";

public 
plugin_init( )
{
    
register_touch"trigger_teleport" EntityPlayerClass "player_touch" );
    
RegisterHam(Ham_Use"func_conveyor""ham_use");
}
 
public 
player_touchentid )
{
    if( 
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}

public 
ham_useweaponid )
{
    if( 
is_user_alive(id) )
    {
        return 
HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;



kww 04-23-2022 07:28

Re: Blocking func_conveyor.
 
Can I suggest func_conveyor removal?

May be like this:
PHP Code:

// in plugin_init()
new ent = -1

do {
    
ent find_ent_by_class(ent"func_conveyor")
    
    
// this could be enough
    
entity_set_vector(entEV_VEC_origin, { -4096.0, -4096.0, -4096.0 }) // move it outside of map
}
while(
ent


Craxor 04-23-2022 07:46

Re: Blocking func_conveyor.
 
I dont want to remove it just disable, removing would be an option too only if the entity would be respanwed next round

kww 04-23-2022 07:51

Re: Blocking func_conveyor.
 
Quote:

Originally Posted by Craxor (Post 2777632)
I dont want to remove it just disable, removing would be an option too only if the entity would be respanwed next round

What entity?

If you need to bring it back then set its origin to 0.0
PHP Code:

entity_set_vector(entEV_VEC_origin, { 0.00.00.0 }) 


Craxor 04-23-2022 07:59

Re: Blocking func_conveyor.
 
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 ?

kww 04-23-2022 08:15

Re: Blocking func_conveyor.
 
Quote:

Originally Posted by Craxor (Post 2777634)
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.00.00.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_conveyorEntsent// 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 iArraySize(g_conveyorEnts); i++)
    {
        
entity_set_vector(iEV_VEC_originoutside_map)
    }
}

public 
execute_me_on_duel_end_or_new_round()
{
    
// on duel end, loop through every registered entity and move it back
    
for(new iArraySize(g_conveyorEnts); i++)
    {
        
entity_set_vector(iEV_VEC_originback_to_map)
    }



JocAnis 04-23-2022 09:28

Re: Blocking func_conveyor.
 
Hi, there is option to change entity's value, in this situation it would be 'speed' but problem is that u need it only for specific players/duel. You can try to solve this with pev_groupinfo maybe?

https://i.imgur.com/bYkFdkp.jpeg

Natsheh 04-23-2022 09:30

Re: Blocking func_conveyor.
 
Try blocking the touch of trigger_push

kww 04-23-2022 13:00

Re: Blocking func_conveyor.
 
Quote:

Originally Posted by JocAnis (Post 2777645)
Hi, there is option to change entity's value, in this situation it would be 'speed' but problem is that u need it only for specific players/duel. You can try to solve this with pev_groupinfo maybe?

https://i.imgur.com/bYkFdkp.jpeg

on duels they fight 1v1, last CT vs T

Craxor 04-24-2022 04:50

Re: Blocking func_conveyor.
 
`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.00.00.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 
iArraySize(g_conveyorEnts); i++)
    {
        
entity_set_vector(iEV_VEC_originoutside_map)
    }
}

public 
addx(id)
{
    for(new 
iArraySize(g_conveyorEnts); i++)
    {
        
entity_set_vector(iEV_VEC_originback_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_conveyorEntsent// if there are any entity, register it
        
}
    }
    while(
ent




All times are GMT -4. The time now is 21:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.