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

1v1 teleport plugin errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 03-20-2019 , 14:35   1v1 teleport plugin errors
Reply With Quote #1

When this plugin is 1v1, it is teleport the players. The code should have errors, but I can't find the error and can't understand it. Sometimes it teleport to the wrong location. Sometimes not teleport to the noscope zone. Can you help me fix it?

PHP Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR "Ak0"
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <sdktools>
#include <cstrike>
//#include <sdkhooks>
int RandomRoom;
ConVar teleport61;

public 
Plugin myinfo 
{
    
name "[AWP] 1v1 Teleport"
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url ""
};

public 
OnPluginStart()
{
    
teleport61 CreateConVar("sm_awp_teleport""1");
    
HookEvent("player_death"Player_Death61EventHookMode_Pre);
    
HookEvent("round_start"Round_Start61);
}

public 
Action Round_Start61(Handle event, const char[] namebool dontBroadcast
{
    
int random61 GetRandomInt(14);
    
RandomRoom random61;
    
ServerCommand("sm plugins load Awp/deagle_qq");
    
ServerCommand("sm plugins unload Awp/noscope");
    
ServerCommand("sm plugins unload abner_bhop");
}

public 
Action Player_Death61(Handle eventchar[] namebool dontBroadcast)
{
    if(
GetConVarInt(teleport61) == 1)
    {
        if (
LivePlayer(2) == && LivePlayer(3) == 1)
        {
            
ServerCommand("sm plugins unload Awp/deagle_qq");
            if (
RandomRoom == 1)
            {
                
ServerCommand("sm plugins load abner_bhop");
            }
            else if (
RandomRoom == 2)
            {
                
ServerCommand("sm plugins load Awp/noscope");
            }
            else if (
RandomRoom == 3)
            {
                
ServerCommand("sm plugins load abner_bhop");
            }
            else if (
RandomRoom == 4)
            {
                
ServerCommand("sm plugins load abner_bhop");
            }
        }
        
        
// Bunny Hop Room
        
float bunnyhopT[3];
        
float bunnyhopCT[3];
        
bunnyhopT[0] = 3023.0;
        
bunnyhopT[1] = -866.0;
        
bunnyhopT[2] = 12.0;
        
bunnyhopCT[0] = 3023.0;
        
bunnyhopCT[1] = 992.0;
        
bunnyhopCT[2] = 12.0;
        
        
// NoScope Room
        
float noscopeT[3];
        
float noscopeCT[3];
        
noscopeT[0] = 2626.0;
        
noscopeT[1] = 568.0;
        
noscopeT[2] = -78.0;
        
noscopeCT[0] = 2613.0;
        
noscopeCT[1] = -277.0;
        
noscopeCT[2] = -80.0;
        
        
// labyrinth Room
        
float labyrinthT[3];
        
float labyrinthCT[3];
        
labyrinthT[0] = 1285.0;
        
labyrinthT[1] = -487.0;
        
labyrinthT[2] = -24.0;
        
labyrinthCT[0] = 1285.0;
        
labyrinthCT[1] = -435.0;
        
labyrinthCT[2] = -24.0;
        
        
// KZ Room
        
float kzT[3];
        
float kzCT[3];
        
kzT[0] = 4073.0;
        
kzT[1] = -423.0;
        
kzT[2] = -201.0;
        
kzCT[0] = 3966.0;
        
kzCT[1] = -423.0;
        
kzCT[2] = -201.0;
        
        for (
int i 1<= MaxClientsi++)
        {
            if (
&& IsClientInGame(i) && IsClientConnected(i) && !IsFakeClient(i) && IsPlayerAlive(i))
            {
                if (
LivePlayer(2) == && LivePlayer(3) == 1)
                {
                    
WeaponRemove61(i);
                    
SetEntityHealth(i100);
                    switch (
RandomRoom)
                    {
                    case 
1:
                    {
                        if (
GetClientTeam(i) == 2)
                        {
                            
TeleportEntity(ibunnyhopTNULL_VECTORNULL_VECTOR);
                            
GivePlayerItem(i"weapon_knife");
                        }
                        else if (
GetClientTeam(i) == 3)
                        {
                            
TeleportEntity(ibunnyhopCTNULL_VECTORNULL_VECTOR);
                            
GivePlayerItem(i"weapon_knife");
                        }
                    }
                    case 
2:
                    {
                        if (
GetClientTeam(i) == 2)
                        {
                            
TeleportEntity(inoscopeTNULL_VECTORNULL_VECTOR);
                            
GivePlayerItem(i"weapon_knife");
                        }
                        else if (
GetClientTeam(i) == 3)
                        {
                            
TeleportEntity(inoscopeCTNULL_VECTORNULL_VECTOR);
                            
GivePlayerItem(i"weapon_knife");
                        }
                    }
                    case 
3:
                    {
                        if (
GetClientTeam(i) == 2)
                        {
                            
TeleportEntity(ilabyrinthTNULL_VECTORNULL_VECTOR);
                        }
                        else if (
GetClientTeam(i) == 3)
                        {
                            
TeleportEntity(ilabyrinthCTNULL_VECTORNULL_VECTOR);
                        }
                    }
                    case 
4:
                    {
                        if (
GetClientTeam(i) == 2)
                        {
                            
TeleportEntity(ikzTNULL_VECTORNULL_VECTOR);
                            
GivePlayerItem(i"weapon_knife");
                        }
                        else if (
GetClientTeam(i) == 3)
                        {
                            
TeleportEntity(ikzCTNULL_VECTORNULL_VECTOR);
                            
GivePlayerItem(i"weapon_knife");
                        }
                    }
                }
            }
        }
    }
    }
}

LivePlayer(iTeam)
{
    
int iCounti;
    
iCount 0;
    for (
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == iTeam)
        {
            
iCount++;
        }
    }
    return 
iCount;
}

stock void WeaponRemove61(int client)
{
    
int iEnt;
    for (
int i 0<= 4; ++i)
    {
        while ((
iEnt GetPlayerWeaponSlot(clienti)) != -1)
        {
            
RemovePlayerItem(clientiEnt);
            
AcceptEntityInput(iEnt"Kill");
        }
    }
}

/// void SetCvar(const char[] name, const char[] value)   
/// {   
///     ConVar cvar = FindConVar(name); 
///     if (cvar) 
///     { 
///         cvar.Flags &= ~FCVAR_NOTIFY; 
///         cvar.SetString(value); 
///         cvar.Flags |= FCVAR_NOTIFY; 
///     } 
/// } 
__________________
alphaearth is offline
Reply


Thread Tools
Display Modes

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 04:59.


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