Raised This Month: $51 Target: $400
 12% 

Solved Blocking func_conveyor.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-23-2022 , 07:22   Blocking func_conveyor.
Reply With Quote #1

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;

__________________
Project: Among Us

Last edited by Craxor; 04-25-2022 at 05:29.
Craxor is offline
Send a message via ICQ to Craxor
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-23-2022 , 07:28   Re: Blocking func_conveyor.
Reply With Quote #2

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
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 04-23-2022 at 07:52.
kww is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-23-2022 , 07:46   Re: Blocking func_conveyor.
Reply With Quote #3

I dont want to remove it just disable, removing would be an option too only if the entity would be respanwed next round
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-23-2022 , 07:51   Re: Blocking func_conveyor.
Reply With Quote #4

Quote:
Originally Posted by Craxor View Post
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 }) 
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 04-23-2022 at 07:57.
kww is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-23-2022 , 07:59   Re: Blocking func_conveyor.
Reply With Quote #5

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 ?
__________________
Project: Among Us

Last edited by Craxor; 04-23-2022 at 08:00.
Craxor is offline
Send a message via ICQ to Craxor
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-23-2022 , 08:15   Re: Blocking func_conveyor.
Reply With Quote #6

Quote:
Originally Posted by Craxor View Post
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)
    }

__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 04-23-2022 at 08:22.
kww is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-23-2022 , 09:28   Re: Blocking func_conveyor.
Reply With Quote #7

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?

__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 04-23-2022 at 10:36.
JocAnis is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-23-2022 , 09:30   Re: Blocking func_conveyor.
Reply With Quote #8

Try blocking the touch of trigger_push
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-23-2022 , 13:00   Re: Blocking func_conveyor.
Reply With Quote #9

Quote:
Originally Posted by JocAnis View Post
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?

on duels they fight 1v1, last CT vs T
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-24-2022 , 04:50   Re: Blocking func_conveyor.
Reply With Quote #10

`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

__________________
Project: Among Us

Last edited by Craxor; 04-24-2022 at 04:52.
Craxor is offline
Send a message via ICQ to Craxor
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:28.


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