AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with "trigger_teleport" (https://forums.alliedmods.net/showthread.php?t=132575)

extreme 07-16-2010 12:46

help with "trigger_teleport"
 
Hello. Such a question how to find coordinates destination point of entity "triger_teleport"?

mottzi 07-16-2010 13:35

Re: help with "trigger_teleport"
 
the destination of a trigger_teleport is a info_player_destination or a info_target!

Try to search

Sylwester 07-16-2010 13:44

Re: help with "trigger_teleport"
 
Check this:
PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>

new g_start_names[100][32]
new 
g_end_names[100][32]
new 
g_start_ids[100]
new 
g_start_cnt
new g_end_ids[100]
new 
g_end_cnt


public plugin_init(){
    
register_plugin("GetTeleports""1.0""Sylwester")
    new 
tmp
    
for(new i=0i<g_start_cnti++){
        for(new 
j=0j<g_end_cntj++){
            if(
i==&& equali(g_start_names[i], g_end_names[i]))
                break
            else if(!
equali(g_start_names[i], g_end_names[j]))
                continue
            
tmp g_end_ids[i]
            
g_end_ids[i] = g_end_ids[j]
            
g_end_ids[j] = tmp
            formatex
(g_end_names[j], 31g_end_names[i])
            
formatex(g_end_names[i], 31g_start_names[i])
        }
    }
    
register_clcmd("test""test")
}

public 
test(id){
    new 
Float:o[3]
    
pev(idpev_origino)
    
client_print(0print_console"Your coords %f %f %f"o[0], o[1], o[2])
    for(new 
i=0i<g_start_cnti++){
        
pev(g_end_ids[i], pev_origino)
        
client_print(0print_console"name %s || startid %d || endid %d || end coords %f %f %f",
        
g_start_names[i], g_start_ids[i], g_end_ids[i], o[0], o[1], o[2])
    }
    return 
PLUGIN_HANDLED
}


public 
pfn_keyvalue(entid){
    new 
classname[32], key[32], value[32]
    
copy_keyvalue(classname31key31value31)
    if(
equali(classname,"trigger_teleport")){
        if(
equali(key"target")){
            
g_start_ids[g_start_cnt] = entid
            formatex
(g_start_names[g_start_cnt], 31value)
            
g_start_cnt++
        }
    }else if(
equali(classname,"info_teleport_destination")){
        if(
equali(key"targetname")){
            
g_end_ids[g_end_cnt] = entid
            formatex
(g_end_names[g_end_cnt], 31value)
            
g_end_cnt++
        }
    }



grimvh2 07-16-2010 13:48

Re: help with "trigger_teleport"
 
Quote:

Originally Posted by mottzi (Post 1241547)
the destination of a trigger_teleport is a info_player_destination or a info_target!

Try to search

I always use info_target

Mxnn 07-16-2010 14:19

Re: help with "trigger_teleport"
 
I would add to if statement "|| equali(classname, "info_target") "

mottzi 07-16-2010 15:15

Re: help with "trigger_teleport"
 
and info_player_destination

// yeah senior member :P

extreme 07-16-2010 16:48

Re: help with "trigger_teleport"
 
Sylwester, thanks

ConnorMcLeod 07-19-2010 02:23

Re: help with "trigger_teleport"
 
You may find this code usefull : http://forums.alliedmods.net/showthread.php?p=848089


All times are GMT -4. The time now is 07:12.

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