AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect teleporting on fail at bhop map (https://forums.alliedmods.net/showthread.php?t=215683)

Kia 05-11-2013 03:23

Detect teleporting on fail at bhop map
 
Hello everybody,

I'd like to know if its possible to detect if a player falls down at a bhop Map and gets teleported back to the beginning of that, and if so, how to do that?

Greetz,
Kia.

hornet 05-11-2013 04:21

Re: Detect teleporting on fail at bhop map
 
Hook Touch on trigger_teleport.

Kia 05-11-2013 04:27

Re: Detect teleporting on fail at bhop map
 
But if I have a map which uses teleporters this would be also called or not?

hornet 05-11-2013 04:56

Re: Detect teleporting on fail at bhop map
 
Yes it would. You could check the teleport destination entity for a certain name using pev_targetname from pev_target of the trigger entity.
However, it wouldn't be a consistent solution for every map but you don't have much of a choice.

Kia 05-11-2013 05:02

Re: Detect teleporting on fail at bhop map
 
Hmm okay, I have this code now and it's working, but as I thought it will execute the code also on teleporters.

PHP Code:

public ent_touch(ent,player)
{
    if(!
pev_valid(ent) || !pev_valid(player))
        return 
HAM_IGNORED;
    
    new 
ent_class[33];
    
pev(entpev_classname,  ent_class32)
    
    if(
equali(ent_class"trigger_teleport") && g_Impossible[player])
    {
        
user_kill(player)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE



hornet 05-11-2013 05:07

Re: Detect teleporting on fail at bhop map
 
Like I said, if it's only one specific map, then find the targetname of the teleport destination and condition it that way.

Kia 05-11-2013 05:12

Re: Detect teleporting on fail at bhop map
 
There are about 100 maps. :D

hornet 05-11-2013 05:17

Re: Detect teleporting on fail at bhop map
 
Well then you may have to look into other alternatives. Perhaps check the distance from the info_teleport_destination to info_player_start?

ConnorMcLeod 05-11-2013 05:37

Re: Detect teleporting on fail at bhop map
 
+ sometimes, only 1 point entity is used for destination of new zone, and for back origin if you've just failed in that new zone.

Kia 05-12-2013 01:45

AW: Detect teleporting on fail at bhop map
 
I'll try that, thank you both for your help.


All times are GMT -4. The time now is 16:23.

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