AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problems teleporting players. (https://forums.alliedmods.net/showthread.php?t=163264)

Korxu 07-28-2011 10:54

Problems teleporting players.
 
Hi all ;).

I have this code to move the player to which this aim.
PHP Code:

public f_user_jump(id) {
    if (
is_user_alive(id)) {
        new 
old_or[3], new_or[3]
        
        
get_user_origin(idold_or)
        
get_user_origin(idnew_or3)
                
        
new_or[0] += (( new_or[0] - old_or[0] > 0) ? -50 50)
        
new_or[1] += (( new_or[1] - old_or[1] > 0) ? -50 50)
        
new_or[2] += 20
        
        set_user_origin
(idnew_or)
        
        if(
user_jump_stuck(id)) {
            
set_user_origin(idold_or)
        }
    }
    return 
PLUGIN_HANDLED
}
stock user_jump_stuck(id) {
    new 
Float:origin[3]
    
pev(idpev_originorigin)
    
    
engfunc(EngFunc_TraceHulloriginoriginIGNORE_MONSTERSpev(idpev_flags ) & FL_DUCKING HULL_HEAD HULL_HUMANid0)
    
    return 
get_tr2(0TR_StartSolid)


When the player moves, it goes straight to where it was pointing, but it moves to the side or slightly above. As I can make it go where it points without being pinched on the wall?

And finally, are there a better way to do this?.

Thanks and sorry for my English. Bye ^^.

Leon M. 07-29-2011 05:46

Re: Problems teleporting players.
 
No Feedback -.-


All times are GMT -4. The time now is 00:51.

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