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

[CS:GO] Teleporting a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 12-08-2019 , 14:50   [CS:GO] Teleporting a player
Reply With Quote #1

Hey guys!

I am trying to teleport a player but I am getting a little problem over here...

I need the last argument:
PHP Code:
public int cphandle(Menu menuMenuAction actionint clientint item)
{
    
float vec[2][3];
    
char choice[64];
    
menu.GetItem(itemchoicesizeof(choice));
    if(
action == MenuAction_Select)
    {
        if(
StrEqual(choice"1"))
        {
            
GetClientAbsOrigin(clientvec[0]);
            
GetClientEyeAngles(clientvec[1]);
        }
        else if(
StrEqual(choice"2"))
        {
            
TeleportEntity(clientvec[0], vec[1], NEED THIS ARGUMENT);
        } 
There is the part where I am using the values.

For the argument that I need, I tried to use 'float velocity {0.0, 0.0, 0.0}' and even copying from advanced admin plugin 'Float: {0.0, 0.0, 0.0}'.

What should I do to fix it?

Best Regards,

SpirT.
__________________
SpirT is offline
Balimbanana
Member
Join Date: Jan 2017
Old 12-08-2019 , 15:03   Re: [CS:GO] Teleporting a player
Reply With Quote #2

Use NULL_VECTOR for no change.
Edit: Or make another float with 0 0 0 to reset their velocity.

Last edited by Balimbanana; 12-08-2019 at 15:04.
Balimbanana is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 12-17-2019 , 16:22   Re: [CS:GO] Teleporting a player
Reply With Quote #3

Quote:
Originally Posted by Balimbanana View Post
Use NULL_VECTOR for no change.
Edit: Or make another float with 0 0 0 to reset their velocity.
I am doing a plugin where player can save a CheckPoint and then with the menu, he can teleport to the saved checkpoint. But when teleporting it is teleporting me to the position I saved but inside the ground... And the noclip function is not saving on the file to set it to ON or OFF and isn't even giving noclip hability to the player.

PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_fj"Command_CheckPoint);
    
    
BuildPath(Path_SMncfilesizeof(ncfile), "configs/SpirT/ncchoice.cfg");
    
    
g_enable CreateConVar("sm_enablefj""1""Liga e desliga o plugin");
    
    
AutoExecConfig(true"checkpoint.plugin""SpirT");
}

public 
Action Command_CheckPoint(int clientint args)
{
    
int enabled GetConVarInt(g_enable);
    if(
enabled == 0)
    {
        return 
Plugin_Handled;
    }
    else if(
enabled == 1)
    {
        
CreateCPMenu(client).Display(clientMENU_TIME_FOREVER);
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Handled;
}

public 
Menu CreateCPMenu(int client)
{
    
Menu menu = new Menu(cphandleMENU_ACTIONS_ALL);
    
menu.SetTitle("[Cyg] FunJump Menu:");
    
    
menu.AddItem("1""Save");
    
menu.AddItem("2""Teleport");
    
    
KeyValues kv = new KeyValues("NoclipChoice");
    
kv.ImportFromFile(ncfile);
    
    
char steam[64];
    if (
GetClientAuthId(clientAuthId_Steam2steamsizeof(steam)))
    {
        if (
kv.JumpToKey(steamtrue))
        {
            
char check[32];
            
kv.GetString("action"checksizeof(check), "OFF");
            if(
StrEqual(check"OFF"))
            {
                
menu.AddItem("3""Noclip [OFF]");
            }
            else if(
StrEqual(check"ON"))
            {
                
menu.AddItem("3""Noclip [ON]");
            }
        }
    }
    
    
delete kv;
    
    
menu.ExitButton true;
    
    return 
menu;
}

public 
int cphandle(Menu menuMenuAction actionint clientint item)
{
    
float position[3];
    
char choice[64];
    
menu.GetItem(itemchoicesizeof(choice));
    if(
action == MenuAction_Select)
    {
        if(
StrEqual(choice"1"))
        {
            
//GetClientAbsOrigin(client, vec[0]);
            //GetClientEyeAngles(client, vec[1]);
            //if(StrEqual(choice, "2"))
            //{
            //    TeleportEntity(client, vec[0], vec[1], NULL_VECTOR);
            //}
            
GetEntPropVector(clientProp_Send"m_vecOrigin"position);
        }
        else if(
StrEqual(choice"2"))
        {
            
TeleportEntity(clientpositionNULL_VECTORNULL_VECTOR);
        }
        else if(
StrEqual(choice"3"))
        {
            
KeyValues kv = new KeyValues("NoclipChoice");
            
kv.ImportFromFile(ncfile);
            
            
char steam[64];
            if (
GetClientAuthId(clientAuthId_Steam2steamsizeof(steam)))
            {
                if (
kv.JumpToKey(steamtrue))
                {
                    
char check[32];
                    
kv.GetString("action"checksizeof(check));
                    
                    if (
StrEqual(check"ON"))
                    {
                        
SetEntityMoveType(clientMOVETYPE_WALK);
                        
kv.SetString("action""OFF");
                        
kv.ExportToFile(ncfile);
                        
CreateCPMenu(client).Display(clientMENU_TIME_FOREVER);
                    }
                    else if (
StrEqual(check"OFF"))
                    {
                        
SetEntityMoveType(clientMOVETYPE_NOCLIP);
                        
kv.SetString("action""ON");
                        
kv.ExportToFile(ncfile);
                        
CreateCPMenu(client).Display(clientMENU_TIME_FOREVER);
                    }
                }
            }
            
            
delete kv;
        }        
    }
    else if(
action == MenuAction_End)
    {
        
delete menu;
    }

What do i need to change?

Best Regards and thanks for your help,

SpirT.
__________________
SpirT 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 11:13.


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