Raised This Month: $32 Target: $400
 8% 

Undefined Symbol errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 10-09-2020 , 10:46   Undefined Symbol errors
Reply With Quote #1

I'm trying to add the CFG file to my plugin, but I'm dont successful. could you please help in this regard. my goal here is to try to prevent players from passing by adding barricades in sections without saferoom Gates.

PHP Code:
#pragma semicolon 1

#include <left4dhooks>

#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#define PATCH                    "logs\\l4d2_wait_players.log"
#define PATCH                    "data/anti-rush_system-l4d2.cfg"

bool g_bFirstItemPickedUp;
bool g_bisAlreadyDone;
bool g_bisClean;
bool g_bLocked;
bool g_bIsClientLoading[MAXPLAYERS 1];
bool g_bIsFirstAction[MAXPLAYERS 1];
ConVar cvar_ClientTimeOutcvar_Delaycvar_LockHintTextcvar_LockRoundOnecvar_LockRoundTwo;
float g_SpawnPos[3];
float g_pos[3];
int g_iClientTimeout[MAXPLAYERS 1];
int g_iCooldown;
int g_iMap;
int g_iPlayerSpawn;
int g_iRoundStart;

char datafilepath[PLATFORM_MAX_PATH];
static 
char LOG[256];
static 
Handle g_IsWayUnlocked null;


public 
Plugin myinfo 
{
    
name "l4d2_wait_players",
    
author "SupermenCJ,DarkWob",
    
description "L4D2 wait loading players after map start",
    
version "1.0",
    
url "https://regionz.ml"
}


public 
void OnPluginStart()
{
    
BuildPath(Path_SMLOGsizeof(LOG), PATCH);
    
BuildPath(Path_SMdatafilepathsizeof(datafilepath), "data/l4d2_wait_players.txt");
    
BuildPath(Path_SMsDataFilePathsizeof(sDataFilePath), "data/anti-rush_system-l4d2.cfg");
    if (!
FileExists(sDataFilePath))
    {
        
SetFailState("[LOCK] Data File Not Found!");
    }
    
    
cvar_ClientTimeOut CreateConVar("l4d2_wait_timeout""25""How many seconds plugin will wait after a map starts before giving up on waiting for a client. (Default: 30)");
    
cvar_Delay CreateConVar("l4d2_wait_delay""40""Delay to enable bots if no human does.");
    
cvar_LockHintText CreateConVar("l4d2_wait_hinttext""1""Does the plugin print the countdown in center screen? (Default: 1)");
    
cvar_LockRoundOne CreateConVar("l4d2_wait_roundone""40""How long the door is locked on round 1 - this round takes longer to load. (Default: 40)");
    
cvar_LockRoundTwo CreateConVar("l4d2_wait_roundtwo""30""How long the door is locked on round two. (Default: 30)");
    
    
RegAdminCmd("sm_coord"CMD_CoordADMFLAG_ROOT"Узнать координаты места");
    
RegAdminCmd("sm_coordsave"CMD_RecordCoordADMFLAG_ROOT"Запись координат места для текущей карты");
    
RegAdminCmd("sm_savecoord"CMD_RecordCoordADMFLAG_ROOT"Запись координат места для текущей карты");
    
    
HookEvent("round_start"Event_RoundStartEventHookMode_PostNoCopy);
    
HookEvent("round_end"Event_RoundEndEventHookMode_PostNoCopy);
    
HookEvent("item_pickup"Event_ItemPickup);
    
HookEvent("player_left_checkpoint"Event_LeftSaferoom);
    
HookEvent("player_spawn"Event_PlayerSpawnEventHookMode_PostNoCopy);
    
HookEvent("player_team"Event_JoinTeam);
    
    
g_IsWayUnlocked CreateGlobalForward("Lock_CheckpointDoorStartOpened"ET_Ignore);
}

public 
void OnMapStart()
{
    
FindConVar("sb_stop").SetInt(0);
    
g_bisAlreadyDone false;
    
g_bisClean false;
    
g_bLocked true;
    
g_iCooldown cvar_LockRoundOne.IntValue;
    
g_iRoundStart 0;
}

public 
Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weapon)
{    
    if (
buttons IN_MOVELEFT || buttons IN_BACK || buttons IN_FORWARD || buttons IN_MOVERIGHT || buttons IN_USE)
    {
        if (
GetClientTeam(client) != 2)
        {
            return 
Plugin_Continue;
        }
        
        if (
IsFakeClient(client))
        {
            if (
FindConVar("sb_stop").IntValue == && !g_bisAlreadyDone)
            {
                
FindConVar("sb_stop").SetInt(1);
                
CreateTimer(cvar_Delay.FloatValueStartBotsDelay);
            }
        }
        
        if (!
IsFakeClient(client))
        {
            if (
FindConVar("sb_stop").IntValue == && !g_bisAlreadyDone)
            {
                
g_bisAlreadyDone true;
                
FindConVar("sb_stop").SetInt(0);
            }
        }
    }
    return 
Plugin_Continue;
}
    
public 
Action StartBotsDelay(Handle timer)
{
    if (
FindConVar("sb_stop").IntValue == && !g_bisAlreadyDone)
    {
        
g_bisAlreadyDone true;
        
FindConVar("sb_stop").SetInt(0);
    }
    return 
Plugin_Stop;
}

public 
Action Event_ItemPickup(Event event, const char[] namebool dontBroadcast)
{
    if (!
g_bFirstItemPickedUp)
    {
        
g_bFirstItemPickedUp true;
        
CreateTimer(0.2PluginStartSequence01);
    }
}

public 
Action PluginStartSequence01(Handle timer)
{
    for (
int i 1<= MaxClientsi++)
    {
        
g_bIsClientLoading[i] = true;
        
g_iClientTimeout[i] = 0;
    }
    
CreateTimer(0.2PluginStartSequence02);
}

public 
Action PluginStartSequence02(Handle timer)
{
    
CreateTimer(1.0LoadingTimer_TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
}

public 
Action LoadingTimer(Handle timer)
{
    if (
isFinishedLoading())
    {
        
CreateTimer(1.0timerLockSwitch,_TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
        return 
Plugin_Stop;
    }
    return 
Plugin_Continue;
}

public 
Action timerLockSwitch(Handle timerany client)
{
    if(
g_iCooldown 0)
    {
        if (
cvar_LockHintText.BoolValue)
            
PrintHintTextToAll("%i second(s) till the way unlock!"g_iCooldown);
        
        if (
g_iCooldown == 10)
            
PrintToChatAll("\x03[\x01\x04LOCK\x01\x03]\x01 \x04Way will unlocked in\x01 \x03%i\x01 \x04seconds!\x01"g_iCooldown);
    }
    else if (
g_iCooldown == 0)
    {
        
WayUnlocked();
        
PrintToChatAll("\x03[\x01\x04LOCK\x01\x03]\x01 \x04Way are unlocked!\x01");
        if (
cvar_LockHintText.BoolValue)
            
PrintHintTextToAll("WAY ARE UNLOCKED!");
    }
    else if (
g_iCooldown 0)
        return 
Plugin_Stop;
    
    
g_iCooldown--;
    
    return 
Plugin_Continue;
}

public 
Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
FindConVar("sb_stop").SetInt(0);
    
    
g_bFirstItemPickedUp false;
    
g_bisAlreadyDone false;
    
g_bisClean false;
    
g_bLocked true;
    
    if (
g_iPlayerSpawn == && g_iRoundStart == 0)
        
CreateTimer(g_iMap == 5.0 1.0tmrStart);
    
g_iRoundStart 1;
}

public 
Action Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    
g_bisClean false;
    
g_bLocked true;
    
ResetState();
}

public 
void OnClientConnected(int client)
{
    
g_bIsFirstAction[client] = true;
}

public 
void OnClientDisconnect(int client)
{
    
g_bIsClientLoading[client] = false;
    
g_iClientTimeout[client] = 0;
}

public 
Action Event_JoinTeam(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (
isClientValid(client))
    {
        
g_bIsClientLoading[client] = false;
        
g_iClientTimeout[client] = 0;
    }
}

bool isFinishedLoading()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientConnected(i))
        {
            if (!
IsClientInGame(i) && !IsFakeClient(i))
            {
                
g_iClientTimeout[i]++;
                if (
g_bIsClientLoading[i])
                {
                    if (
g_iClientTimeout[i] == 1)
                        
g_bIsClientLoading[i] = true;
                }
                
                if (
g_iClientTimeout[i] == cvar_ClientTimeOut.IntValue)
                    
g_bIsClientLoading[i] = false;
            }
            else
                
g_bIsClientLoading[i] = false;
        }
        else
            
g_bIsClientLoading[i] = false;
    }
    
    return !
isAnyClientLoading();
}

bool isAnyClientLoading()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
g_bIsClientLoading[i])
            return 
true;
    }
    return 
false;
}

bool isClientValid(int client)
{
    if (
client <= 0)
        return 
false;
    if (!
IsClientConnected(client))
        return 
false;
    if (!
IsClientInGame(client))
        return 
false;
    if (
IsFakeClient(client))
        return 
false;
    return 
true;
}

public 
Action Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    if (
g_iPlayerSpawn == && g_iRoundStart == 1)
        
CreateTimer(g_iMap == 5.0 1.0tmrStart);
    
g_iPlayerSpawn 1;
}

void WayUnlocked()
{
    if (!
g_bisClean)
    {
        
g_bisClean true;
        
//ServerCommand("sm_cvar director_no_survivor_bots 0");
        
ServerCommand("sm_cvar sb_stop 0");
        
g_bLocked false;
    }
    
    
Call_StartForward(g_IsWayUnlocked);
    
Call_Finish();
}

public 
Action Event_LeftSaferoom(Event event, const char[] namebool dontBroadcast)
{
    if (!
g_bLocked)
        return 
Plugin_Continue;
    
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    if (
client && IsClientInGame(client) && g_bIsFirstAction[client])
    {
        
g_bIsFirstAction[client] = false;
        return 
Plugin_Continue;
    }
    
    if (
client && IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
        
TeleportClientBack(client);
    
    return 
Plugin_Continue;
}

public 
Action L4D_OnFirstSurvivorLeftSafeArea(int client)
{
    if (
g_bLocked)
        return 
Plugin_Handled;
    else
        return 
Plugin_Continue;
}

void TeleportClientBack(int client)
{
    
char sMap[64];
    
float pos[3];
    
bool IsAllowed true;
    
GetCurrentMap(sMapsizeof(sMap));
    
    if (
StrEqual(sMap"c1m1_hotel"))
    {
        
pos[0] = 568.0pos[1] = 5707.0pos[2] = 2848.0;
    }
    else if (
StrEqual(sMap"c1m2_streets"))
    {
        
pos[0] = 2371.7pos[1] = 5164.9pos[2] = 475.0;
    }
    else if (
StrEqual(sMap"c1m3_mall"))
    {
        
pos[0] = 6747.3pos[1] = -1440.7pos[2] = 50.6;
    }
    else if (
StrEqual(sMap"c1m4_atrium"))
    {    
        
pos[0] = -2033.6pos[1] = -4607.9pos[2] = 559.0;
    }
    else if (
StrEqual(sMap"c2m1_highway"))
    {
        
pos[0] = 10905.8pos[1] = 7890.9pos[2] = -527.0;
    }
    else if (
StrEqual(sMap"c2m2_fairgrounds"))
    {
        
pos[0] = 1648.7pos[1] = 2893.4pos[2] = 33.2;
    }
    else if (
StrEqual(sMap"c2m3_coaster"))
    {
        
pos[0] = 4450.6pos[1] = 2056.4pos[2] = -36.9;
    }
    else if (
StrEqual(sMap"c2m4_barns"))
    {
        
pos[0] = 3185.0pos[1] = 3717.1pos[2] = -160.9;
    }
    else if (
StrEqual(sMap"c2m5_concert"))
    {
        
pos[0] = -817.2pos[1] = 2289.1pos[2] = -229.0;
    }
    else if (
StrEqual(sMap"c3m1_plankcountry"))
    {
        
pos[0] = -12543.2pos[1] = 10475.3pos[2] = 271.8;
    }
    else if (
StrEqual(sMap"c3m2_swamp"))
    {
        
pos[0] = -8173.3pos[1] = 7589.1pos[2] = 39.0;
    }
    else if (
StrEqual(sMap"c3m3_shantytown"))
    {
        
pos[0] = -5717.4pos[1] = 2177.3pos[2] = 165.1;
    }
    else if (
StrEqual(sMap"c3m4_plantation"))
    {
        
pos[0] = -5074.4pos[1] = -1685.5pos[2] = -69.8;
    }
    else if (
StrEqual(sMap"c4m1_milltown_a"))
    {
        
pos[0] = -6984.3pos[1] = 7704.1pos[2] = 131.2;
    }
    else if (
StrEqual(sMap"c4m2_sugarmill_a"))
    {
        
pos[0] = 3663.1pos[1] = -1697.4pos[2] = 259.5;
    }
    else if (
StrEqual(sMap"c4m3_sugarmill_b"))
    {
        
pos[0] = -1818.2pos[1] = -13704.6pos[2] = 158.8;
    }
    else if (
StrEqual(sMap"c4m4_milltown_b"))
    {
        
pos[0] = 3884.5pos[1] = -1586.0pos[2] = 259.2;
    }
    else if (
StrEqual(sMap"c4m5_milltown_escape"))
    {
        
pos[0] = -3048.1pos[1] = 7823.6pos[2] = 142.8;
    }
    else if (
StrEqual(sMap"c5m1_waterfront"))
    {
        
pos[0] = 767.9pos[1] = 674.1pos[2] = -455.0;
    }
    else if (
StrEqual(sMap"c5m2_park"))
    {
        
pos[0] = -4437.9pos[1] = -1250.1pos[2] = -322.1;
    }
    else if (
StrEqual(sMap"c5m3_cemetery"))
    {
        
pos[0] = 6448.5pos[1] = 8428.1pos[2] = 27.0;
    }
    else if (
StrEqual(sMap"c5m4_quarter"))
    {
        
pos[0] = -3046.3pos[1] = 4881.7pos[2] = 95.0;
    }
    else if (
StrEqual(sMap"c5m5_bridge"))
    {
        
pos[0] = -12039.7pos[1] = 5843.2pos[2] = 155.0;
    }
    else if (
StrEqual(sMap"c6m1_riverbank"))
    {
        
pos[0] = 928.0pos[1] = 4278.0pos[2] = 115.0;
    }
    else if (
StrEqual(sMap"c6m2_bedlam"))
    {
        
pos[0] = 3156.7pos[1] = -1235.4pos[2] = -268.9;
    }
    else if (
StrEqual(sMap"c6m3_port"))
    {
        
pos[0] = -2450.8pos[1] = -523.2pos[2] = -228.9;
    }    
    else if (
StrEqual(sMap"c7m1_docks"))
    {
        
pos[0] = 13830.0pos[1] = 2894.8pos[2] = 59.2;
    }
    else if (
StrEqual(sMap"c7m2_barge"))
    {
        
pos[0] = 10788.4pos[1] = 2479.7pos[2] = 203.0;
    }
    else if (
StrEqual(sMap"c7m3_port"))
    {
        
pos[0] = 1219.6pos[1] = 3254.6pos[2] = 195.0;
    }
    else if (
StrEqual(sMap"c8m1_apartment"))
    {
        
pos[0] = 1766.9pos[1] = 878.1pos[2] = 459.0;
    }
    else if (
StrEqual(sMap"c8m2_subway"))
    {
        
pos[0] = 2874.7pos[1] = 3233.4pos[2] = 43.0;
    }
    else if (
StrEqual(sMap"c8m3_sewers"))
    {
        
pos[0] = 10849.5pos[1] = 4755.3pos[2] = 46.4;
    }
    else if (
StrEqual(sMap"c8m4_interior"))
    {
        
pos[0] = 12357.0pos[1] = 12260.3pos[2] = 42.7;
    }
    else if (
StrEqual(sMap"c8m5_rooftop"))
    {
        
pos[0] = 5579.6pos[1] = 8348.0pos[2] = 5563.0;
    }
    else if (
StrEqual(sMap"c9m1_alleys"))
    {
        
pos[0] = -10015.6pos[1] = -8564.0pos[2] = 13.1;
    }
    else if (
StrEqual(sMap"c9m2_lots"))
    {
        
pos[0] = 238.1pos[1] = -1338.8pos[2] = -148.9;
    }
    else if (
StrEqual(sMap"c10m1_caves"))
    {
        
pos[0] = -11717.4pos[1] = -14888.7pos[2] = -198.5;
    }
    else if (
StrEqual(sMap"c10m2_drainage"))
    {
        
pos[0] = -11135.1pos[1] = -9126.9pos[2] = -564.9;
    }
    else if (
StrEqual(sMap"c10m3_ranchhouse"))
    {
        
pos[0] = -8308.3pos[1] = -5547.5pos[2] = 2.0;
    }
    else if (
StrEqual(sMap"c10m4_mainstreet"))
    {
        
pos[0] = -3065.6pos[1] = 135.5pos[2] = 355.0;
    }
    else if (
StrEqual(sMap"c10m5_houseboat"))
    {
        
pos[0] = 1963.1pos[1] = 4729.9pos[2] = -36.9;
    }
    else if (
StrEqual(sMap"c11m1_greenhouse"))
    {
        
pos[0] = 6853.6pos[1] = -681.1pos[2] = 795.0;
    }
    else if (
StrEqual(sMap"c11m2_offices"))
    {
        
pos[0] = 5123.5pos[1] = 2613.8pos[2] = 70.0;
    }
    else if (
StrEqual(sMap"c11m3_garage"))
    {
        
pos[0] = -5373.3pos[1] = -3080.7pos[2] = 43.0;
    }
    else if (
StrEqual(sMap"c11m4_terminal"))
    {
        
pos[0] = -370.8pos[1] = 3580.5pos[2] = 431.9;
    }
    else if (
StrEqual(sMap"c11m5_runway"))
    {
        
pos[0] = -6714.3pos[1] = 12058.9pos[2] = 178.9;
    }
    else if (
StrEqual(sMap"c12m1_hilltop") || StrEqual(sMap"C12m1_hilltop"))
    {
        
pos[0] = -8043.8pos[1] = -15147.0pos[2] = 294.9;
    }
    else if (
StrEqual(sMap"c12m2_traintunnel") || StrEqual(sMap"C12m2_traintunnel"))
    {
        
pos[0] = -6649.4pos[1] = -6801.1pos[2] = 375.0;
    }
    else if (
StrEqual(sMap"c12m3_bridge") || StrEqual(sMap"C12m3_bridge"))
    {
        
pos[0] = -916.9pos[1] = -10373.5pos[2] = -38.1;
    }
    else if (
StrEqual(sMap"c12m4_barn") || StrEqual(sMap"C12m4_barn"))
    {
        
pos[0] = 7703.3pos[1] = -11386.0pos[2] = 466.8;
    }
    else if (
StrEqual(sMap"c12m5_cornfield") || StrEqual(sMap"C12m5_cornfield"))
    {
        
pos[0] = 10447.4pos[1] = -391.5pos[2] = -1.9;
    }
    else if (
StrEqual(sMap"c13m1_alpinecreek"))
    {
        
pos[0] = -3048.7pos[1] = -741.8pos[2] = 101.8;
    }
    else if (
StrEqual(sMap"c13m2_southpinestream"))
    {
        
pos[0] = 8778.0pos[1] = 7157.1pos[2] = 522.8;
    }
    else if (
StrEqual(sMap"c13m3_memorialbridge"))
    {
        
pos[0] = -4420.4pos[1] = -5145.5pos[2] = 123.0;
    }
    else if (
StrEqual(sMap"c13m4_cutthroatcreek"))
    {
        
pos[0] = -3396.6pos[1] = -9301.5pos[2] = 387.0;
    }
    else if (
StrEqual(sMap"l4d2_city17_01"))
    {
        
pos[0] = 4000.7pos[1] = -5344.0pos[2] = -92.9;
    }
    else if (
StrEqual(sMap"l4d2_city17_02"))
    {
        
pos[0] = 859.4pos[1] = 2388.1pos[2] = 79.0;
    }
    else if (
StrEqual(sMap"l4d2_city17_03"))
    {
        
pos[0] = 4054.7pos[1] = 802.5pos[2] = 27.0;
    }
    else if (
StrEqual(sMap"l4d2_city17_04"))
    {
        
pos[0] = -1755.2pos[1] = 1942.3pos[2] = -100.9;
    }
    else if (
StrEqual(sMap"l4d2_city17_05"))
    {
        
pos[0] = 10122.1pos[1] = 12351.0pos[2] = -604.8;
    }
    else if (
StrEqual(sMap"srocchurch"))
    {
        
pos[0] = 1139.018310pos[1] = 1165.581909pos[2] = 515.258483;
    }
    else if (
StrEqual(sMap"plaza_espana"))
    {
        
pos[0] = -8265.963867pos[1] = -9271.015625pos[2] = 91.025924;
    }
    else if (
StrEqual(sMap"maria_cristina"))
    {
        
pos[0] = -9940.217773pos[1] = 6386.005859pos[2] = -144.974075;
    }
    else if (
StrEqual(sMap"mnac"))
    {
        
pos[0] = 9281.953125pos[1] = 12409.876953pos[2] = -4452.974121;
    }    
    else if (
StrEqual(sMap"l4d2_stadium1_apartment"))
    {
        
pos[0] = -218.690124pos[1] = 1203.255737pos[2] = 14.774141;
    }
    else if (
StrEqual(sMap"l4d2_stadium2_riverwalk"))
    {
        
pos[0] = -1257.007568pos[1] = 422.781219pos[2] = -204.974075;
    }
    else if (
StrEqual(sMap"l4d2_vs_stadium2_riverwalk"))
    {
        
pos[0] = -1257.007568pos[1] = 422.781219pos[2] = -204.974075;
    }
    else if (
StrEqual(sMap"l4d2_stadium3_city1"))
    {
        
pos[0] = 1620.423583pos[1] = 6824.679199pos[2] = -397.864837;
    }
    else if (
StrEqual(sMap"l4d2_stadium4_city2"))
    {
        
pos[0] = 624.662475pos[1] = -558.739562pos[2] = -535.213989;
    }
    else if (
StrEqual(sMap"l4d2_stadium5_stadium"))
    {
        
pos[0] = 7627.667968pos[1] = -5058.360839pos[2] = 39.025917;
    }
    else
        
IsAllowed false;
        
    if (!
IsAllowed)
    {
        
KeyValues kv = new KeyValues("data");
        
kv.ImportFromFile(datafilepath);
        if (
kv.JumpToKey(sMap))
        {
            
kv.GetVector("position"pos);
            
IsAllowed true;
        }
        
delete kv;
    }
    
    if (
IsAllowed)
        
TeleportEntity(clientposNULL_VECTORNULL_VECTOR);
    else
        
TeleportEntity(clientg_SpawnPosNULL_VECTORNULL_VECTOR);
}

public 
Action CMD_RecordCoord(int clientint args)
{
    if (!
client)
        return 
Plugin_Handled;
    
    if (!
SetTeleportEndPoint(client))
    {
        
ReplyToCommand(client"[VERSUS TOOL] Coordinate Error");
        return 
Plugin_Handled;
    }
    
    
char sMap[64];
    
GetCurrentMap(sMapsizeof(sMap));
    
    
g_pos[2] -= 8.0;
    
    
KeyValues kv = new KeyValues("data");
    
kv.ImportFromFile(datafilepath);
    
    
kv.JumpToKey(sMaptrue);
    
kv.SetVector("position"g_pos);
    
kv.Rewind();
    
kv.ExportToFile(datafilepath);
    
delete kv;
    
    
PrintToChat(client"\x01Текущие координаты \x03pos[0] = %.1f pos[1] = %.1f pos[2] = %.1f\x01 были сохранены в KeyValues для карты \x05%s"g_pos[0], g_pos[1], g_pos[2], sMap);
    
    return 
Plugin_Handled;
}

public 
Action tmrStart(Handle timer)
{
    
g_iMap 0;
    
ResetState();

    
int client;
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && GetClientTeam(i) == && IsPlayerAlive(i))
        {
            
client i;
            break;
        }
    }

    if (
client)
    {
        
GetClientAbsOrigin(clientg_SpawnPos);
        
g_SpawnPos[2] += 25.0;
    }
}

public 
void OnMapEnd()
{
    
g_iMap 1;
    
ResetState();
}

void ResetState()
{
    
g_iRoundStart 0;
    
g_iPlayerSpawn 0;
    
    if (
g_iRoundStart 1)
        
g_iCooldown cvar_LockRoundOne.IntValue;
    else
        
g_iCooldown cvar_LockRoundTwo.IntValue;
}

public 
Action CMD_Coord(int clientint args)
{
    if (!
client)
        return 
Plugin_Handled;
    
    if (!
SetTeleportEndPoint(client))
    {
        
ReplyToCommand(client"[VERSUS TOOL] Coordinate Error");
        return 
Plugin_Handled;
    }
    
    
char sMap[64];
    
GetCurrentMap(sMapsizeof(sMap));
    
    
g_pos[2] -= 8.0;
    
    
PrintToChat(client"\x01else if (StrEqual(sMap, \"\x04%s\x01\")){\x03pos[0] = %.1f; pos[1] = %.1f; pos[2] = %.1f;\x01}"sMapg_pos[0], g_pos[1], g_pos[2]);
    
LogToFile(LOG"Карта %s | координаты pos[0] = %.1f pos[1] = %.1f pos[2] = %.1f"sMapg_pos[0], g_pos[1], g_pos[2]);
    
    return 
Plugin_Handled;
}

bool SetTeleportEndPoint(int client)
{
    
float vAngles[3];
    
float vOrigin[3];
    
float vBuffer[3];
    
float vStart[3];
    
float Distance;
    
    
GetClientEyePosition(client,vOrigin);
    
GetClientEyeAngles(clientvAngles);
    
    
Handle g_trace TR_TraceRayFilterEx(vOriginvAnglesMASK_SHOTRayType_InfinitePlayer_TraceFilter);

    if (
TR_DidHit(g_trace))
    {
        
TR_GetEndPosition(vStartg_trace);
        
GetVectorDistance(vOriginvStartfalse);
        
Distance = -35.0;
        
GetAngleVectors(vAnglesvBufferNULL_VECTORNULL_VECTOR);
        
g_pos[0] = vStart[0] + (vBuffer[0]*Distance);
        
g_pos[1] = vStart[1] + (vBuffer[1]*Distance);
        
g_pos[2] = vStart[2] + (vBuffer[2]*Distance);
    }
    else
    {
        
g_trace.Close();
        return 
false;
    }
    
g_trace.Close();
    return 
true;
}

public 
bool Player_TraceFilter(int entityint contentsMask)
{
    return 
entity MaxClients || !entity;

Quote:
// l4d2_wait_players.sp(11) : warning 201: redefinition of constant/macro (symbol "PATCH")
// l4d2_wait_players.sp(47) : error 017: undefined symbol "sDataFilePath"
// l4d2_wait_players.sp(47) : error 072: "sizeof" operator is invalid on "function" symbols
// l4d2_wait_players.sp(4 : error 017: undefined symbol "sDataFilePath"
Attached Files
File Type: cfg anti-rush_system-l4d2.cfg (15.9 KB, 61 views)

Last edited by Darkwob; 10-10-2020 at 07:51.
Darkwob is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 10-10-2020 , 07:27   Re: I need help with something.can authors help me
Reply With Quote #2

why isn't anyone helping?
Darkwob is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-10-2020 , 07:41   Re: I need help with something.can authors help me
Reply With Quote #3

1. Lack of interest. Large script.
2. Very simple errors.
3. Errors clearly state what is wrong.
4. Merging 2 different plugins into 1, don't know why or your intent or reason not to use both separately.


Looks like you've only just started scripting, so you need to take the time and initiative to read and learn.

You could have googled the error e.g. "sourcemod undefined symbol" and found several answers within seconds.

Simply fixing the issue for you probably won't help you learn and then you'll post again when stuck at the next step making us write the plugin for you in the end.


"PATCH" is defined twice, need to rename your addition. "sDataFilePath" variable is never defined hence the error message stating so.
__________________

Last edited by Silvers; 10-10-2020 at 07:52.
Silvers 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 12:14.


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