Thread: teleport
View Single Post
Doggg
Member
Join Date: Jun 2018
Old 07-13-2019 , 14:01   Re: teleport
Reply With Quote #12

so like this?
PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>
//#include <sdkhooks>

#pragma newdecls required


public Plugin myinfo 
{
    
name "",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
RegAdminCmd("sm_tp"tpADMFLAG_KICK);
}

public 
Action tp(int clientint args)
{
    if(
args 0)
    {
    
ReplyToCommand(client"[SM] tp <client>");
    return 
Plugin_Handled;
    }
    
    
float origin[3];
    
GetClientAbsOrigin(clientorigin);  
    
char Enteredname[30]; 
    
GetCmdArg(1Enterednamesizeof(Enteredname));
    
char Clientname[30];
    
    for (
int i 1<= MaxClientsi++){
        
            
GetClientName(iClientnamesizeof(Clientname));
            if(
StrEqual(Enteredname,Clientname)){
        
                if(
IsClientConnected(i)){
            
                    if(
IsPlayerAlive(i))
                    {
                    
PrintToChat(client"\x04 You Teleported \x03 %s",Clientname);
                    
PrintToChat(i"\x03 %s Teleported \x04 You",client);
                    
TeleportEntity(ioriginNULL_VECTORNULL_VECTOR);  
                    break;                            
                    }
                    else
                    {
                     
ReplyToCommand(client"Please Enter A Alive Player");
                     break;
                        }
                        
                }
        }
        
    }
    return 
Plugin_Handled;


Last edited by Doggg; 07-13-2019 at 14:39.
Doggg is offline