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

Player-Teleport (sm_goto, sm_bring)


Post New Thread Reply   
 
Thread Tools Display Modes
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 02-18-2012 , 23:05   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #31

Since this plugin is a valuable asset, may I see a fix for the following error please?

Code:
L 02/04/2012 - 00:13:43: [SM] Native "GetClientAbsOrigin" reported: Client 15 is not in game
L 02/04/2012 - 00:13:43: [SM] Displaying call stack trace for plugin "sm_goto.smx":
L 02/04/2012 - 00:13:43: [SM]   [0]  Line 80, /home/groups/alliedmodders/forums/files/6/7/0/4/2/58625.attach::Command_Goto()
11530 is offline
HyperKiLLeR
Junior Member
Join Date: Jan 2010
Old 08-22-2012 , 18:42   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #32

Sorry for not being supporting this for over two years now.. I've started coding with sourcemod again, and I'll improve this plugin soon, so be ready for some nice features

I'll add the check if a player will be stuck in a wall, teleporting with @-parameters and some other things I think of. So stay tuned

Last edited by HyperKiLLeR; 08-22-2012 at 18:44.
HyperKiLLeR is offline
dcx2
Senior Member
Join Date: Sep 2011
Old 08-22-2012 , 18:47   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #33

I have changed the GetCollisionPoint code since this initial post. I will try to find some time to post my latest method here for you if you are interested.
__________________
dcx2 is offline
Horsedick
AlliedModders Donor
Join Date: Sep 2011
Old 08-22-2012 , 18:53   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #34

I like teleporting people into walls... funny, the go to part about putting you right on top of their heads could be reworked to put you beside them instead but I'd rather keep the putting someone into a wall as an option
Horsedick is offline
dcx2
Senior Member
Join Date: Sep 2011
Old 09-12-2012 , 21:07   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #35

One problem with teleporting is that after the target ends up at the destination, they can fall and die. So I do something a bit different now; once I find the teleport destination, I do a second trace to find the ground so that you won't fall.

EDIT: it's less sloppy now, it should work just the same. This snippet can replace the same function in the snippet above. Note the default parameter findFloor, which must be true for the second trace toward the ground to occur. This allows you to optionally teleport the old way, which is better for Infected.

PHP Code:
// Traces forward from a client's eye or foot position until the ray hits MASK_SHOT
// Then checks for the possibility to get stuck.  If teleportee would get stuck,
// walk the ray backwards little by little until they won't get stuck anymore
// If we get too close to the client's position, or we take 100 steps, fail with client pos
stock bool:GetTeleportEndpoint(clientFloat:pos[3], bool:findFloor=true)
{
    
decl Float:vOrigin[3], Float:vAngles[3], Float:vBackwards[3], Float:vUp[3];
    new 
bool:failed false;
    new 
loopLimit 100;    // only check 100 times, as a precaution against runaway loops
    
new Float:downAngles[3];
    new 
Handle:traceDown;
    new 
Float:floor[3];

    
GetClientAbsOrigin(clientfloor);
    
GetClientEyePosition(clientvOrigin);

    
downAngles[0] = 90.0;    //thats right you'd think its a z value - this will point you down
    
GetAngleVectors(downAnglesvUpNULL_VECTORNULL_VECTOR);
    
NormalizeVector(vUpvUp);
    
ScaleVector(vUp, -3.0);    // TODO: percentage of distance from endpoint to eyes instead of fixed distance?

    
GetClientEyeAngles(clientvAngles);
    
GetAngleVectors(vAnglesvBackwardsNULL_VECTORNULL_VECTOR);
    
NormalizeVector(vBackwardsvBackwards);
    
ScaleVector(vBackwards10.0);    // TODO: percentage of distance from endpoint to eyes instead of fixed distance?
    
    
new Handle:trace TR_TraceRayFilterEx(vOriginvAnglesMASK_SHOTRayType_InfiniteTraceEntityFilterPlayer);
            
    if (
TR_DidHit(trace))
    {    
        new 
bool:first true;
                
        while (
first || (IsPlayerStuck(floorclient) && !failed))    // iteratively check if they would become stuck
        
{
            if (
first)
            {
                
TR_GetEndPosition(postrace);
                
first false;
            }
            else
            {
                
SubtractVectors(posvBackwardspos);        // if they would, subtract backwards from the position
            
}
            
//PrintToChat(client, "endpos %f %f %f", pos[0], pos[1], pos[2]);
            
            
if(findFloor)
            {
                
traceDown TR_TraceRayFilterEx(posdownAnglesMASK_SHOTRayType_InfiniteTraceEntityFilterPlayer);
                new 
bool:hit TR_DidHit(traceDown);
                if (
hit)
                {
                    
TR_GetEndPosition(floortraceDown);
                    new 
10;
                    while (
&& IsPlayerStuck(floorclient))
                    {
                        
AddVectors(floorvUpfloor);    // lift off the floor a hair
                        
j--;
                    }
                }
                    
                
CloseHandle(traceDown);
                
                if (!
hit) continue;    // If there is no floor, continue searching
            
}
            else
            {
                
floor pos;
            }
            
//PrintToChat(client, "floorpos %f %f %f", floor[0], floor[1], floor[2]);
            
            
if (GetVectorDistance(posvOrigin) < 10 || loopLimit-- < 1)
            {
                
                
failed true;    // If we get all the way back to the origin without colliding, we have failed
                //PrintToChat(client, "failed to find endpos");
                
GetClientAbsOrigin(clientfloor);
            }
        }
    }
    
    
pos floor;
    
    
CloseHandle(trace);
    return !
failed;        // If we have not failed, return true to let the caller know pos has teleport coordinates

__________________

Last edited by dcx2; 09-12-2012 at 21:47.
dcx2 is offline
vodka00
Veteran Member
Join Date: Jun 2012
Location: Los Angeles
Old 09-20-2012 , 18:15   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #36

Quote:
Originally Posted by psychonic View Post
Also, you might consider using the ProcessTargetString function instead of manually looping clients and comparing names. This will allow for partial name matches or using userids.
Yes, this please so much. If two people have identical names, it becomes very difficult to use this plugin. Otherwise works great, maybe except when you get outside the map you can really go back in.
vodka00 is offline
dcx2
Senior Member
Join Date: Sep 2011
Old 09-20-2012 , 18:32   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #37

Hi Vodka00, if you look at my post #30 in this thread, you will find a modification of HyperKiLLeR's plugin which supports ProcessTargetString. It also won't get stuck in walls. You may want to remove HyperKiLLeR's if you want to use mine, since they use different plugin names.

Note that the plugin in that post does not contain the floor-finding functionality I describe in post #35. If you are so interested, I could update my version to support floor-finding.
__________________
dcx2 is offline
vodka00
Veteran Member
Join Date: Jun 2012
Location: Los Angeles
Old 09-20-2012 , 19:42   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #38

Quote:
Originally Posted by dcx2 View Post
Hi Vodka00, if you look at my post #30 in this thread, you will find a modification of HyperKiLLeR's plugin which supports ProcessTargetString. It also won't get stuck in walls. You may want to remove HyperKiLLeR's if you want to use mine, since they use different plugin names.

Note that the plugin in that post does not contain the floor-finding functionality I describe in post #35. If you are so interested, I could update my version to support floor-finding.
Thanks, I will look at that. But I really liked being able to teleport into walls.
vodka00 is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 09-29-2012 , 15:05   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #39

I want to have !goto command for VIPs but restricted. Can somebody make it so !goto command can be used only once every 3 minutes.
HvG Community is offline
vodka00
Veteran Member
Join Date: Jun 2012
Location: Los Angeles
Old 09-29-2012 , 22:15   Re: Player-Teleport (sm_goto, sm_bring)
Reply With Quote #40

I know you can give the command to VIPs by entering it in admin overrides and maybe give it a flag. If I remember correctly you can do thst
vodka00 is offline
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 08:52.


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