Raised This Month: $ Target: $400
 0% 

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-24-2022 , 04:50   Re: Blocking func_conveyor.
Reply With Quote #1

`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
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-24-2022 , 08:47   Re: Blocking func_conveyor.
Reply With Quote #2

In rmv and addx you are missing ent = ArrayGetCell(g_conveyorEnts, i) to get the actual entity, on which you should do entity_set_vector.
__________________
HamletEagle is offline
Old 04-24-2022, 14:27
kww
This message has been deleted by kww. Reason: nbm
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-25-2022 , 05:29   Re: Blocking func_conveyor.
Reply With Quote #4

Thanks again Captain, your code works perfectly .
__________________
Project: Among Us
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 21:19.


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