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

Solved Native "DataPack.DataPack" was not found


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
born for gaming
Member
Join Date: Aug 2019
Location: Pakistan
Old 09-25-2020 , 00:58   Native "DataPack.DataPack" was not found
Reply With Quote #1

Hi, i am making new plugin name WeaponFight 1 vs 1 in the end of round.

The plugin compile successfuly but when i run the plugin in my server in console he give me error
PHP Code:
[SMUnable to load plugin "weaponfight.smx"Native "DataPack.DataPack" was not found 
i dont know y the plugin is not loading plz help me
here is sp file of plugin

PHP Code:
#pragma semicolon 1
#pragma tabsize 0
#include <sourcemod>
#include <sdktools>
#include <morecolors>
#include <clientprefs>
#include <cstrike>
#include <sdkhooks>

#define MAX_WEAPONS             32  // max weapons
#define TEAM_T                  2
#define TEAM_CT                 3
#define SLAYER_WEAPONFIGHT_VERSION      "1.6.8.7"
#define MAX_FILE_LEN            256
#define SOUND_EXPLODE           "ambient/explosions/explode_8.wav"
#define SOUND_TIMER             "ambient/tones/floor1.wav"

// Colors
#define YELLOW               "\x01"
#define NAME_TEAMCOLOR       "\x02"
#define TEAMCOLOR            "\x03"
#define GREEN                "\x04"
EngineVersion g_Game;
public 
Plugin myinfo =
{
    
name "$L@YER Weapon Fight",
    
author "$L@YER",
    
description "1 vs 1 at the end of round with weapons.",
    
version SLAYER_WEAPONFIGHT_VERSION,
    
url ""
};

float teleloc[3];
float g_winnerspeed;
char ctname[MAX_NAME_LENGTH];
char tname[MAX_NAME_LENGTH];
char ctitems[8][64];
char titems[8][64];
char winnername[MAX_NAME_LENGTH];
char g_declinesound[MAX_FILE_LEN];
char g_beaconsound[MAX_FILE_LEN];
char song[256];
char itemswon[256];
bool g_winnereffects;
bool g_losereffects;
bool g_forcefight;
bool g_enabled;
bool g_alltalk;
bool g_alltalkenabled   false;
bool g_block;
bool g_blockenabled     false;
bool g_randomkill;
bool g_useteleport;
bool g_restorehealth;
bool g_locatorbeam;
bool g_stopmusic;
bool g_intermission;
bool isFighting     false;
bool bombplanted    false;
int ctidtidwinnerloseralivectalivet;
int g_winnerid  0;
int ctagree     = -1;
int tagree      = -1;
int songsfound  0;
int timesrepeated;
int g_iMyWeaponsg_iHealthg_iAccountg_iSpeedg_iArmorOffset;
int g_beamspriteg_halospriteg_lightningg_locatebeamg_locatehalo;
int g_countdowntimerg_winnerhealthg_winnermoneyg_minplayers;
int g_fighttimerfighttimer;
float g_beaconragius;
//Convar
Handle g_Cvarenabled        INVALID_HANDLE;
Handle g_Cvaralltalk        INVALID_HANDLE;
Handle g_Cvarblock          INVALID_HANDLE;
Handle g_Cvarrandomkill     INVALID_HANDLE;
Handle g_Cvarminplayers     INVALID_HANDLE;
Handle g_Cvardeclinesound   INVALID_HANDLE;
Handle g_Cvarbeaconsound    INVALID_HANDLE;
Handle g_Cvaruseteleport    INVALID_HANDLE;
Handle g_Cvarrestorehealth  INVALID_HANDLE;
Handle g_Cvarwinnerspeed    INVALID_HANDLE;
Handle g_Cvarwinnerhealth   INVALID_HANDLE;
Handle g_Cvarwinnermoney    INVALID_HANDLE;
Handle g_Cvarwinnereffects  INVALID_HANDLE;
Handle g_Cvarlosereffects   INVALID_HANDLE;
Handle g_Cvarlocatorbeam    INVALID_HANDLE;
Handle g_Cvarstopmusic      INVALID_HANDLE;
Handle g_Cvarforcefight     INVALID_HANDLE;
Handle g_Cvarcountdowntimer INVALID_HANDLE;
Handle g_Cvarfighttimer     INVALID_HANDLE;
Handle g_Cvarbeaconradius   INVALID_HANDLE;
Handle g_WeaponSlots    INVALID_HANDLE;
new 
Handle:g_hWeaponsTrie;
new 
Handle:g_hWeaponsArray;
new 
Handle:g_hSoundsArray;
new 
g_iWeaponsArray = -1;
int g_bFightRoundNoZoom[MAX_WEAPONS];
int g_bFightRoundAutoSwitch[MAX_WEAPONS];
new 
g_iRandomInt;
new 
String:g_sWeaponsArray[64];
char g_WeaponNames[MAX_WEAPONS][ ] = 

    
"primammo",     "secammo",  "vest",         "vesthelm",
    
"defuser",      "nvgs",     "galil",        "ak47",     
    
"scout",
    
"sg552",        "awp",      "g3sg1",        "famas"
    
"m4a1",         "aug",      "sg550",        "glock",
    
"usp",          "p228",     "deagle",       "elite",
    
"fiveseven",    "m3",       "xm1014",       "mac10",
    
"tmp",          "mp5navy",  "ump45",        "p90",
    
"m249",         "c4",       "knife"
};
new 
Handle:sv_alltalk               INVALID_HANDLE;
new 
Handle:sm_noblock               INVALID_HANDLE;
new 
Handle:sm_noblock_nades;
new 
g_WeaponParent;
new 
g_iCollisionGroupOffs;
new 
Handle:g_Cvar_SoundPrefDefault  INVALID_HANDLE;
new 
Handle:g_Cookie_SoundPref       INVALID_HANDLE;
new 
g_soundPrefs[MAXPLAYERS+1];
new 
Handle:g_Cookie_FightPref       INVALID_HANDLE;
new 
g_fightPrefs[MAXPLAYERS+1];
new 
Handle:g_Cvar_IsBotFightAllowed INVALID_HANDLE;
new 
bool:g_isBotFightAllowed        false;
new 
g_showWinner;
new 
g_removeNewPlayer;
new 
Handle:g_Cvar_ShowWinner        INVALID_HANDLE;
new 
Handle:g_Cvar_RemoveNewPlayer   INVALID_HANDLE;
new 
g_iActiveWeapon[66];
new 
g_iFOVOffs;
new 
bool:g_bSetRestrict;
new 
Handle:g_Cvar_Restrict   INVALID_HANDLE;
new 
g_iActiveWeaponOffset = -1;
new 
bool:g_bSDKHooksLoaded;
new 
bool:g_bOnTakeDamage;

public 
__ext_sdkhooks_SetNTVOptional()
{
    
MarkNativeAsOptional("SDKHook");
    
MarkNativeAsOptional("SDKHookEx");
    
MarkNativeAsOptional("SDKUnhook");
    
MarkNativeAsOptional("SDKHooks_TakeDamage");
    
MarkNativeAsOptional("SDKHooks_DropWeapon");
    return 
0;
}

public 
void OnPluginStart()
{

    
g_Game GetEngineVersion();
    if (
g_Game != Engine_CSGO && g_Game != Engine_CSS)
        
SetFailState("This plugin is for CSGO/CSS only.");
        
    
sv_alltalk FindConVar("sv_alltalk");
    if (!
sv_alltalk)
    {
        
SetFailState("[WeaponFight] Cannot find sv_alltalk cvar.");
    }
    
LoadTranslations("weaponfight.phrases");
    
CreateConVar("SLAYER_WeaponFight_version",SLAYER_WEAPONFIGHT_VERSION,"Plugin version",FCVAR_NOTIFY|FCVAR_REPLICATED);
    
g_Cvarenabled CreateConVar("sm_weaponfight_enabled""1""Enable this plugin. 0 = Disabled"0false0.0false0.0);
    
g_Cvaralltalk CreateConVar("sm_weaponfight_alltalk""1""Enable alltalk while weapon fight. 0 = Disabled"0false0.0false0.0);
    
g_Cvarblock CreateConVar("sm_weaponfight_block""0""Enable player blocking (disable sm_noblock) if sm_noblock is enabled while weapon fight. 0 = Disabled"0false0.0false0.0);
    
g_Cvarrandomkill CreateConVar("sm_weaponfight_randomkill""0""Enable random kill after weapon fight time end. 0 = Disabled"0false0.0false0.0);
    
g_Cvarminplayers CreateConVar("sm_weaponfight_minplayers""4""Minimum number of players before weapon fights will trigger."0false0.0false0.0);
    
g_Cvaruseteleport CreateConVar("sm_weaponfight_useteleport""1""Use smart teleport system prior to weapon fight. 0 = Disabled"0false0.0false0.0);
    
g_Cvarrestorehealth CreateConVar("sm_weaponfight_restorehealth""1""Give players full health before weapon fight. 0 = Disabled"0false0.0false0.0);
    
g_Cvarforcefight CreateConVar("sm_weaponfight_forcefight""0""Force weapon fight at end of round instead of prompting with menus. 0 = Disabled"0false0.0false0.0);
    
g_Cvarwinnerhealth CreateConVar("sm_weaponfight_winnerhealth""0""Total health to give the winner. 0 = Disabled"0false0.0false0.0);
    
g_Cvarwinnerspeed CreateConVar("sm_weaponfight_winnerspeed""0""Total speed given to the winner. 0 = Disabled (1.0 is normal speed, 2.0 is twice normal)"0false0.0false0.0);
    
g_Cvarwinnermoney CreateConVar("sm_weaponfight_winnermoney""0""Total extra money given to the winner. 0 = Disabled"0false0.0false0.0);
    
g_Cvarwinnereffects CreateConVar("sm_weaponfight_winnereffects""1""Enable special effects on the winner. 0 = Disabled"0false0.0false0.0);
    
g_Cvarlosereffects CreateConVar("sm_weaponfight_losereffects""1""Dissolve loser body using special effects. 0 = Disabled"0false0.0false0.0);
    
g_Cvarlocatorbeam CreateConVar("sm_weaponfight_locatorbeam""1""Use locator beam between players if they are far apart. 0 = Disabled"0false0.0false0.0);
    
g_Cvarstopmusic CreateConVar("sm_weaponfight_stopmusic""0""Stop music when fight is over. Useful when used with gungame. 0 = Disabled"0false0.0false0.0);
    
g_Cvardeclinesound CreateConVar("sm_weaponfight_declinesound""weaponfight/chicken.wav""The sound to play when player declines to weapon."0false0.0false0.0);
    
g_Cvarbeaconsound CreateConVar("sm_weaponfight_beaconsound""buttons/blip1.wav""The sound to play when beacon ring shows."0false0.0false0.0);
    
g_Cvarcountdowntimer CreateConVar("sm_weaponfight_countdowntimer""3""Number of seconds to count down before a weapon fight."0false0.0false0.0);
    
g_Cvarfighttimer CreateConVar("sm_weaponfight_fighttimer""30""Number of seconds to allow for knifing.    Players get slayed after this time limit expires."0false0.0false0.0);
    
g_Cvarbeaconradius CreateConVar("sm_weaponfight_beaconradius""800""Beacon radius."0false0.0false0.0);
    
g_Cvar_IsBotFightAllowed CreateConVar("sm_weaponfight_botfight""0""Allow bot to weapon fight with bot. 0 = Disabled"0false0.0false0.0);
    
g_isBotFightAllowed GetConVarBool(g_Cvar_IsBotFightAllowed);
    
g_Cvar_ShowWinner CreateConVar("sm_weaponfight_showwinner""0""Show winner. (0 - Top left, 1 - Chat)"0false0.0false0.0);
    
g_showWinner GetConVarInt(g_Cvar_ShowWinner);
    
g_Cvar_RemoveNewPlayer CreateConVar("sm_weaponfight_removenewplayer""0""Remove player connected when fight is started. (0 - Slay, 1 - Move to spec)"0false0.0false0.0);
    
g_removeNewPlayer GetConVarInt(g_Cvar_RemoveNewPlayer);
    new 
f_WeaponSlots[32] = {-1,-1,-1,-1,-1,-1,3,3,3,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,4,2};
    
g_WeaponSlots CreateTrie();
    new 
i;
    while (
32)
    {
        
SetTrieValue(g_WeaponSlotsg_WeaponNames[i], f_WeaponSlots[i], true);
        
i++;
    }
    
HookEvent("player_spawn"EventPlayerSpawnEventHookMode:1);
    
HookEvent("player_death"EventPlayerDeathEventHookMode:1);
    
HookEvent("item_pickup"EventItemPickupEventHookMode:1);
    
HookEvent("weapon_zoom"EventWeaponZoomEventHookMode:1);
    
HookEvent("weapon_fire"EventWeaponFireEventHookMode:1);
    
HookEvent("bomb_planted"EventBombPlantedEventHookMode:2);
    
HookEvent("round_end"EventBombPlantedEventHookMode:2);
    
HookEvent("round_start"EventRoundStartEventHookMode:2);
    
HookConVarChange(g_CvarenabledOnSettingChanged);
    
HookConVarChange(g_CvaralltalkOnSettingChanged);
    
HookConVarChange(g_CvarblockOnSettingChanged);
    
HookConVarChange(g_CvarrandomkillOnSettingChanged);
    
HookConVarChange(g_CvarminplayersOnSettingChanged);
    
HookConVarChange(g_CvaruseteleportOnSettingChanged);
    
HookConVarChange(g_CvarrestorehealthOnSettingChanged);
    
HookConVarChange(g_CvarwinnerhealthOnSettingChanged);
    
HookConVarChange(g_CvarwinnerspeedOnSettingChanged);
    
HookConVarChange(g_CvarwinnermoneyOnSettingChanged);
    
HookConVarChange(g_CvarwinnereffectsOnSettingChanged);
    
HookConVarChange(g_CvarlosereffectsOnSettingChanged);
    
HookConVarChange(g_CvarlocatorbeamOnSettingChanged);
    
HookConVarChange(g_CvarstopmusicOnSettingChanged);
    
HookConVarChange(g_CvarforcefightOnSettingChanged);
    
HookConVarChange(g_CvarcountdowntimerOnSettingChanged);
    
HookConVarChange(g_CvarfighttimerOnSettingChanged);
    
HookConVarChange(g_CvarbeaconradiusOnSettingChanged);
    
HookConVarChange(g_Cvar_IsBotFightAllowedOnSettingChanged);
    
HookConVarChange(g_Cvar_ShowWinnerOnSettingChanged);
    
HookConVarChange(g_Cvar_RemoveNewPlayerOnSettingChanged);
    
g_Cvar_SoundPrefDefault CreateConVar("sm_weaponfight_soundprefdefault""1""Default sound setting for new users."0false0.0false0.0);
    
g_Cookie_SoundPref RegClientCookie("sm_weaponfight_soundpref""WeaponFight Sound Pref"CookieAccess:2);
    
g_Cookie_FightPref RegClientCookie("sm_weaponfight_fightpref""WeaponFight Fight Pref"CookieAccess:2);
    
RegConsoleCmd("wfmenu"MenuKnifeFight"Show Weapon fight settings menu."0);
    
1;
    while (
<= MaxClients)
    {
        
g_soundPrefs[i] = GetConVarInt(g_Cvar_SoundPrefDefault);
        
g_fightPrefs[i] = 0;
        
i++;
    }
    
g_hWeaponsTrie CreateTrie();
    
SetTrieValue(g_hWeaponsTrie"galil"any:1true);
    
SetTrieValue(g_hWeaponsTrie"ak47"any:1true);
    
SetTrieValue(g_hWeaponsTrie"scout"any:1true);
    
SetTrieValue(g_hWeaponsTrie"sg552"any:1true);
    
SetTrieValue(g_hWeaponsTrie"awp"any:1true);
    
SetTrieValue(g_hWeaponsTrie"g3sg1"any:1true);
    
SetTrieValue(g_hWeaponsTrie"famas"any:1true);
    
SetTrieValue(g_hWeaponsTrie"m4a1"any:1true);
    
SetTrieValue(g_hWeaponsTrie"aug"any:1true);
    
SetTrieValue(g_hWeaponsTrie"sg550"any:1true);
    
SetTrieValue(g_hWeaponsTrie"glock"any:1true);
    
SetTrieValue(g_hWeaponsTrie"usp"any:1true);
    
SetTrieValue(g_hWeaponsTrie"p228"any:1true);
    
SetTrieValue(g_hWeaponsTrie"deagle"any:1true);
    
SetTrieValue(g_hWeaponsTrie"elite"any:1true);
    
SetTrieValue(g_hWeaponsTrie"fiveseven"any:1true);
    
SetTrieValue(g_hWeaponsTrie"m3"any:1true);
    
SetTrieValue(g_hWeaponsTrie"xm1014"any:1true);
    
SetTrieValue(g_hWeaponsTrie"mac10"any:1true);
    
SetTrieValue(g_hWeaponsTrie"tmp"any:1true);
    
SetTrieValue(g_hWeaponsTrie"mp5navy"any:1true);
    
SetTrieValue(g_hWeaponsTrie"ump45"any:1true);
    
SetTrieValue(g_hWeaponsTrie"p90"any:1true);
    
SetTrieValue(g_hWeaponsTrie"m249"any:1true);
    
SetTrieValue(g_hWeaponsTrie"knife"any:1true);
    
g_iMyWeapons FindSendPropInfo("CBaseCombatCharacter""m_hMyWeapons");
    if (
g_iMyWeapons == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CBaseCombatCharacter::m_hMyWeapons");
    }
    
g_iHealth FindSendPropInfo("CCSPlayer""m_iHealth");
    if (
g_iHealth == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CSSPlayer::m_iHealth");
    }
    
g_iArmorOffset FindSendPropInfo("CCSPlayer""m_ArmorValue");
    if (
g_iArmorOffset == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CCSPlayer::m_ArmorValue");
    }
    
g_iAccount FindSendPropInfo("CCSPlayer""m_iAccount");
    if (
g_iAccount == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CSSPlayer::m_iAccount");
    }
    
g_iSpeed FindSendPropInfo("CCSPlayer""m_flLaggedMovementValue");
    if (
g_iSpeed == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CSSPlayer::m_flLaggedMovementValue");
    }
    
g_WeaponParent FindSendPropInfo("CBaseCombatWeapon""m_hOwnerEntity");
    if (
g_WeaponParent == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CBaseCombatWeapon::m_hOwnerEntity");
    }
    
g_iCollisionGroupOffs FindSendPropInfo("CBaseEntity""m_CollisionGroup");
    if (
g_iCollisionGroupOffs == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CBaseEntity::m_CollisionGroup");
    }
    
g_iFOVOffs FindSendPropInfo("CBasePlayer""m_iFOV");
    if (
g_iFOVOffs == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CBasePlayer::m_iFOV");
    }
    
g_iActiveWeaponOffset FindSendPropInfo("CAI_BaseNPC""m_hActiveWeapon");
    if (
g_iActiveWeaponOffset == -1)
    {
        
SetFailState("[WeaponFight] Error - Unable to get offset for CAI_BaseNPC::m_hActiveWeapon");
    }
    
g_hWeaponsArray CreateArray(1280);
    
g_hSoundsArray CreateArray(1280);
    
AutoExecConfig(true"weaponfight""sourcemod");
}

public 
OnMapStart()
{
    
songsfound = -1;
    
ClearArray(g_hSoundsArray);
    
ParsFile("weaponfight_sounds.ini"false);

}

public 
OnConfigsExecuted()
{
    
decl String:buffer[256];
    
g_beamsprite PrecacheModel("materials/sprites/lgtning.vmt"false);
    
g_halosprite PrecacheModel("materials/sprites/halo01.vmt"false);
    
g_lightning PrecacheModel("materials/sprites/tp_beam001.vmt"false);
    
g_locatebeam PrecacheModel("materials/sprites/physbeam.vmt"false);
    
g_locatehalo PrecacheModel("materials/sprites/plasmahalo.vmt"false);
    
PrecacheSound("ambient/explosions/explode_8.wav"true);
    
PrecacheSound("ambient/tones/floor1.wav"true);
    
g_iWeaponsArray = -1;
    
g_iRandomInt 0;
    
ClearArray(g_hWeaponsArray);
    
ParsFile("weaponfight_list.ini"true);
    
GetConVarString(g_Cvardeclinesoundg_declinesound256);
    if (!
PrecacheSound(g_declinesoundtrue))
    {
        
LogError("[WeaponFight] Could not pre-cache sound: %s"g_declinesound);
    }
    else
    {
        
Format(buffer256"sound/%s"g_declinesound);
        
AddFileToDownloadsTable(buffer);
    }
    
GetConVarString(g_Cvarbeaconsoundg_beaconsound256);
    if (!
PrecacheSound(g_beaconsoundtrue))
    {
        
LogError("[WeaponFight] Could not pre-cache sound: %s"g_beaconsound);
    }
    else
    {
        
Format(buffer256"sound/%s"g_beaconsound);
        
AddFileToDownloadsTable(buffer);
    }
    
g_enabled GetConVarBool(g_Cvarenabled);
    
g_alltalk GetConVarBool(g_Cvaralltalk);
    
g_block GetConVarBool(g_Cvarblock);
    
g_randomkill GetConVarBool(g_Cvarrandomkill);
    
g_minplayers GetConVarInt(g_Cvarminplayers);
    
g_useteleport GetConVarBool(g_Cvaruseteleport);
    
g_restorehealth GetConVarBool(g_Cvarrestorehealth);
    
g_winnerhealth GetConVarInt(g_Cvarwinnerhealth);
    
g_winnerspeed GetConVarFloat(g_Cvarwinnerspeed);
    
g_winnereffects GetConVarBool(g_Cvarwinnereffects);
    
g_losereffects GetConVarBool(g_Cvarlosereffects);
    
g_locatorbeam GetConVarBool(g_Cvarlocatorbeam);
    
g_stopmusic GetConVarBool(g_Cvarstopmusic);
    
g_forcefight GetConVarBool(g_Cvarforcefight);
    
g_countdowntimer GetConVarInt(g_Cvarcountdowntimer);
    
g_fighttimer GetConVarInt(g_Cvarfighttimer);
    
g_beaconragius GetConVarFloat(g_Cvarbeaconradius);
}

public 
OnAutoConfigsBuffered()
{
    
g_intermission false;
}

public 
OnSettingChanged(Handle:convarString:oldValue[], String:newValue[])
{
    if (
g_Cvarenabled == convar)
    {
        
g_enabled newValue[0] == 49;
    }
    else
    {
        if (
g_Cvaralltalk == convar)
        {
            
g_alltalk newValue[0] == 49;
        }
        if (
g_Cvarblock == convar)
        {
            
g_block newValue[0] == 49;
        }
        if (
g_Cvarrandomkill == convar)
        {
            
g_randomkill newValue[0] == 49;
        }
        if (
g_Cvaruseteleport == convar)
        {
            
g_useteleport newValue[0] == 49;
        }
        if (
g_Cvarrestorehealth == convar)
        {
            
g_restorehealth newValue[0] == 49;
        }
        if (
g_Cvarwinnereffects == convar)
        {
            
g_winnereffects newValue[0] == 49;
        }
        if (
g_Cvarlosereffects == convar)
        {
            
g_losereffects newValue[0] == 49;
        }
        if (
g_Cvarlocatorbeam == convar)
        {
            
g_locatorbeam newValue[0] == 49;
        }
        if (
g_Cvarstopmusic == convar)
        {
            
g_stopmusic newValue[0] == 49;
        }
        if (
g_Cvarforcefight == convar)
        {
            
g_forcefight newValue[0] == 49;
        }
        if (
g_Cvarwinnerhealth == convar)
        {
            
g_winnerhealth StringToInt(newValue10);
        }
        if (
g_Cvarwinnerspeed == convar)
        {
            
g_winnerspeed StringToFloat(newValue);
        }
        if (
g_Cvarwinnermoney == convar)
        {
            
g_winnermoney StringToInt(newValue10);
        }
        if (
g_Cvarcountdowntimer == convar)
        {
            
g_countdowntimer StringToInt(newValue10);
        }
        if (
g_Cvarfighttimer == convar)
        {
            
g_fighttimer StringToInt(newValue10);
        }
        if (
g_Cvarbeaconradius == convar)
        {
            
g_beaconragius StringToFloat(newValue);
        }
        if (
g_Cvarminplayers == convar)
        {
            
g_minplayers StringToInt(newValue10);
        }
        if (
g_Cvar_IsBotFightAllowed == convar)
        {
            
g_isBotFightAllowed newValue[0] == 49;
        }
        if (
g_Cvar_ShowWinner == convar)
        {
            
g_showWinner GetConVarInt(g_Cvar_ShowWinner);
        }
        if (
g_Cvar_RemoveNewPlayer == convar)
        {
            
g_removeNewPlayer GetConVarInt(g_Cvar_RemoveNewPlayer);
        }
    }
    return 
0;
}

WeaponHandler(clientteamid)
{
    if (
isFighting)
    {
        new 
count;
        new 
i;
        while (
<= 128)
        {
            new 
weaponentity = -1;
            new 
String:weaponname[32];
            
weaponentity GetEntDataEnt2(clientg_iMyWeapons);
            if (
IsValidEdict(weaponentity))
            {
                
GetEdictClassname(weaponentityweaponname32);

                if (
weaponentity != -&& !StrEqual(weaponname"worldspawn"false))
                {

                    if (
teamid == || teamid == 2)
                    {
                        
RemovePlayerItem(clientweaponentity);
                        
RemoveEdict(weaponentity);
                        if (
teamid == 3)
                        {
                            
count++;
                        }
                        if (
teamid == 2)
                        {
                            
count++;
                        }
                    }
                }
            }
            
+= 4;
        }
    }
    else
    {
        if (
g_iWeaponsArray == -1)
        {
            
RemoveWeapon(client"knife");
        }
        else
        {
            
decl String:sBuffer[64];
            
Format(sBuffer64g_sWeaponsArray);
            
ReplaceString(sBuffer64"weapon_"""true);
            
RemoveWeapon(clientsBuffer);
        }
        new 
i;
        while (
<= 7)
        {
            if (
IsClientInGame(client))
            {
                if (
teamid == 3)
                {
                    if (!
StrEqual(ctitems[i], ""false))
                    {
                        
GivePlayerItem(clientctitems[i], 0);
                    }
                }
                if (
teamid == 2)
                {
                    if (!
StrEqual(titems[i], ""false))
                    {
                        
GivePlayerItem(clienttitems[i], 0);
                    }
                }
            }
            
i++;
        }
    }
    return 
0;
}

public 
GiveWeapon(client)
{
    if (
g_iWeaponsArray == -1)
    {
        
GivePlayerItem(client"weapon_knife"0);
        
FakeClientCommand(client"use weapon_knife");
    }
    else
    {
        
decl String:sBuffer[64];
        
decl iBuffer;
        
Format(sBuffer64"use %s"g_sWeaponsArray);
        
iBuffer GivePlayerItem(clientg_sWeaponsArray0);
        
SetEntDataEnt2(clientg_iActiveWeaponOffsetiBufferfalse);
        
FakeClientCommand(clientsBuffer);
        
ReplaceString(sBuffer64"use weapon_"""true);
        if (
GetTrieValue(g_WeaponSlotssBufferiBuffer))
        {
            
g_iActiveWeapon[client] = GetPlayerWeaponSlot(clientiBuffer);
        }
    }
    return 
0;
}

public 
Action:WinnerEffects()
{
    
CreateTimer(0.1LightningTimerany:01);
    
CreateTimer(0.6ExplosionTimerany:01);
    return 
Action:0;
}

public 
Action:DelayWeapon(Handle:timerany:data)
{
    new 
Handle:pack data;
    
ResetPack(packfalse);
    new 
client ReadPackCell(pack);
    new 
String:item[64];
    
ReadPackString(packitem64);
    
CloseHandle(pack);
    if (!
isFighting)
    {
        return 
Action:0;
    }
    
RemoveWeapon(clientitem);
    return 
Action:0;
}

public 
Action:LightningTimer(Handle:timer)
{
    if (
winner)
    {
        static 
TimesRepeated;
        
TimesRepeated += 1;
        if (
TimesRepeated <= 30)
        {
            
Lightning();
            return 
Action:0;
        }
        
TimesRepeated 0;
        return 
Action:4;
    }
    return 
Action:4;
}

public 
Action:ExplosionTimer(Handle:timer)
{
    if (
winner)
    {
        static 
TimesRepeated;
        
TimesRepeated += 1;

        if (
TimesRepeated <= && IsClientInGame(winner))
        {
            
decl Float:fPos[3];
            
GetClientAbsOrigin(winnerfPos);
            
EmitAmbientSound("ambient/explosions/explode_8.wav"fPos07501.01000.0);
            return 
Action:0;
        }
        
TimesRepeated 0;
    }
    return 
Action:4;
}

public 
Action:KillPlayer(Handle:timerany:clientid)
{

    if (
IsClientInGame(clientid) && IsPlayerAlive(clientid))
    {

        if (!
isFighting && ctid != clientid && tid != clientid)
        {
            return 
Action:0;
        }

        if (
g_removeNewPlayer == && isFighting && ctid != clientid && tid != clientid)
        {
            
ChangeClientTeam(clientid1);
            
RemoveAllWeapons();
            return 
Action:0;
        }
        
ForcePlayerSuicide(clientid);
    }
    return 
Action:0;
}

public 
Action:SlapTimer(Handle:timer)
{
    static 
TimesRepeated;
    if (
TimesRepeated <= 1)
    {
        
SlapPlayer(ctid0false);
        
TimesRepeated += 1;
        return 
Action:0;
    }
    
TimesRepeated 0;
    return 
Action:4;
}

public 
Action:TeleportTimer(Handle:timer)
{
    
TeleportEntity(tidtelelocNULL_VECTORNULL_VECTOR);
    return 
Action:0;
}

public 
Action:ItemsWon(Handle:timerany:client)
{
    static 
TimesRepeated;
    if (!
IsClientInGame(client))
    {
        return 
Action:4;
    }
    if (
TimesRepeated <= 2)
    {
        
PrintHintText(clientitemswon);
        
TimesRepeated += 1;
        return 
Action:0;
    }
    
TimesRepeated 0;
    return 
Action:4;
}

public 
Action:StartFight()
{

    if (
ctid && tid)
    {
        return 
Action:0;
    }
    
alivect 0;
    
alivet 0;
    new 
1;
    while (
<= MaxClients)
    {
        new 
team;

        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
team GetClientTeam(i);
            if (
team == 3)
            {
                
alivect += 1;
            }
            if (
team == 2)
            {
                
alivet += 1;
            }
        }
        
i++;
    }

    if (
alivect == && alivet == && bombplanted)
    {
        return 
Action:0;
    }
    
isFighting true;

    if (!
IsPlayerAlive(ctid) || !IsPlayerAlive(tid) || GetClientCount(true) < g_minplayers)
    {
        
CancelFight();
        return 
Action:0;
    }
    
RemoveAllWeapons();
    if (
songsfound != -1)
    {
        if (
songsfound)
        {
            
GetArrayString(g_hSoundsArrayGetRandomInt(0songsfound), song256);
        }
        else
        {
            
GetArrayString(g_hSoundsArray0song256);
        }
        new 
clients[MaxClients];
        new 
total;
        
1;
        while (
<= MaxClients)
        {

            if (
IsClientInGame(i) && g_soundPrefs[i])
            {
                
total++;
                
clients[total] = i;
            }
            
i++;
        }
        if (
total)
        {
            
EmitSound(clientstotalsong, -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
        }
    }
    
CreateTimer(2.0StartBeaconctid1);
    
CreateTimer(1.0StartBeaconTtid0);
    
PrintHintTextToAll("%t""Removing weapons");
    
WeaponHandler(ctid3);
    
WeaponHandler(tid2);
    if (
g_alltalk)
    {
        
g_alltalkenabled GetConVarBool(sv_alltalk);
        if (!
g_alltalkenabled)
        {
            
SetConVarInt(sv_alltalk1falsefalse);
        }
        
g_alltalkenabled = !g_alltalkenabled;
    }
    if (
g_block)
    {
        if (!
sm_noblock)
        {
            
sm_noblock FindConVar("sm_noblock");
        }
        if (
sm_noblock)
        {
            
g_blockenabled = !GetConVarBool(sm_noblock);
            if (!
g_blockenabled)
            {
                
SetConVarInt(sm_noblock0falsefalse);
            }
            
g_blockenabled = !g_blockenabled;
        }
        if (!
sm_noblock_nades)
        {
            
sm_noblock_nades FindConVar("sm_noblock_nades");
        }
        if (
sm_noblock_nades)
        {
            
g_blockenabled = !GetConVarBool(sm_noblock_nades);
            if (!
g_blockenabled)
            {
                
SetConVarInt(sm_noblock_nades0falsefalse);
            }
            
g_blockenabled = !g_blockenabled;
        }
    }
    
g_Cvar_Restrict FindConVar("sm_allow_restricted_pickup");

    if (
g_Cvar_Restrict && !GetConVarBool(g_Cvar_Restrict))
    {
        
SetConVarInt(g_Cvar_Restrict1falsefalse);
        
g_bSetRestrict true;
    }
    if (
g_useteleport)
    {
        if (
g_restorehealth)
        {
            
SetEntData(ctidg_iHealthany:5004true);
            
SetEntData(tidg_iHealthany:5004true);
        }
        new 
Float:ctvec[3] = 0.0;
        new 
Float:tvec[3] = 0.0;
        new 
Float:distance[1] = 0.0;
        
GetClientAbsOrigin(ctidctvec);
        
GetClientAbsOrigin(tidtvec);
        
SetEntData(ctidg_iCollisionGroupOffsany:24true);
        
SetEntData(tidg_iCollisionGroupOffsany:24true);
        
distance[0] = GetVectorDistance(ctvectvectrue);
        if (
distance[0] >= 600000.0)
        {
            
teleloc ctvec;
            
CreateTimer(0.1SlapTimerany:01);
            
CreateTimer(0.5TeleportTimerany:00);
        }
        else
        {
            if (
g_locatorbeam)
            {
                
CreateTimer(0.1DrawBeamsTimerany:01);
            }
        }
    }
    else
    {
        if (
g_locatorbeam)
        {
            
CreateTimer(0.1DrawBeamsTimerany:01);
        }
    }
    
CreateTimer(1.0Countdownany:01);
    return 
Action:0;
}

public 
Action:CancelFight()
{
    
ctagree = -1;
    
tagree = -1;
    
isFighting false;

    if (
g_stopmusic && songsfound != -1)
    {
        new 
clients[MaxClients];
        new 
total;
        new 
1;
        while (
<= MaxClients)
        {

            if (
IsClientInGame(i) && g_soundPrefs[i])
            {
                
total++;
                
clients[total] = i;
            }
            
i++;
        }
        if (
total)
        {
            
EmitSound(clientstotalsong, -207561.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
        }
    }
    if (
winner)
    {
        if (
IsPlayerAlive(winner))
        {
            
WeaponHandler(winnerGetClientTeam(winner));
            new 
i;
            while (
<= 7)
            {
                
i++;
            }
        }
    }
    return 
Action:0;
}

public 
Action:FightTimer(Handle:timer)
{
    if (!
isFighting)
    {
        return 
Action:4;
    }
    if (
<= fighttimer)
    {
        
PrintHintTextToAll("%t: %i""Time remaining"fighttimer);
        if (
fighttimer 6)
        {
            
EmitSoundToAll("ambient/tones/floor1.wav", -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
        }
        
fighttimer -= 1;
        return 
Action:0;
    }
    new 
healthCT GetClientHealth(ctid);
    new 
healthT GetClientHealth(tid);
    if (
healthT == healthCT)
    {
        if (
g_randomkill)
        {
            if (
GetRandomInt(01))
            {
                
CreateTimer(0.1KillPlayerctid0);
                
CreateTimer(0.1KillPlayertid0);
            }
            else
            {
                
CreateTimer(0.1KillPlayertid0);
                
CreateTimer(0.1KillPlayerctid0);
            }
        }
        else
        {
            
CreateTimer(0.1KillPlayerctid0);
            
CreateTimer(0.1KillPlayertid0);
        }
    }
    else
    {
        if (
healthT healthCT)
        {
            
CreateTimer(0.1KillPlayertid0);
        }
        
CreateTimer(0.1KillPlayerctid0);
    }
    
PrintHintTextToAll("%t""Fight draw");
    return 
Action:4;
}

public 
Action:Countdown(Handle:timer)
{
    if (!
isFighting)
    {
        
timesrepeated g_countdowntimer;
        return 
Action:4;
    }
    
SetEntDataFloat(ctidg_iSpeed1.0true);
    
SetEntDataFloat(tidg_iSpeed1.0true);
    if (
timesrepeated >= 1)
    {
        
PrintHintTextToAll("%t: %i""Prepare fight"timesrepeated);
        
timesrepeated -= 1;
        return 
Action:0;
    }
    else
    {
        if (
g_bSDKHooksLoaded)
        {
            
SDKHook(ctidSDKHookType:2OnTakeDamage);
            
SDKHook(tidSDKHookType:2OnTakeDamage);
            
g_bOnTakeDamage true;
        }
        if (
g_restorehealth)
        {
            
SetEntData(ctidg_iHealthany:1004true);
            
SetEntData(ctidg_iArmorOffsetany:1004true);
            
SetEntData(tidg_iHealthany:1004true);
            
SetEntData(tidg_iArmorOffsetany:1004true);
        }
    }
    
PrintHintTextToAll("%t""Fight");
    
GiveWeapon(ctid);
    
GiveWeapon(tid);
    
SetEntData(ctidg_iCollisionGroupOffsany:54true);
    
SetEntData(tidg_iCollisionGroupOffsany:54true);
    
timesrepeated g_countdowntimer;
    
CreateTimer(1.0FightTimerany:01);
    return 
Action:4;
}

public 
Action:DrawBeamsTimer(Handle:timer)
{

    if (!
isFighting || !IsPlayerAlive(ctid) || !IsPlayerAlive(tid))
    {
        return 
Action:4;
    }
    new 
Float:ctvec[3] = 0.0;
    new 
Float:tvec[3] = 0.0;
    new 
Float:distance[1] = 0.0;
    new 
color[4] = {255,75,75,255};
    
GetClientEyePosition(ctidctvec);
    
GetClientEyePosition(tidtvec);
    
distance[0] = GetVectorDistance(ctvectvectrue);
    if (
distance[0] < 200000.0)
    {
        return 
Action:4;
    }
    
TE_SetupBeamPoints(ctvectvecg_locatebeamg_locatehalo110.15.05.0010.0color255);
    
TE_SendToClient(tid0.0);
    
TE_SetupBeamPoints(tvecctvecg_locatebeamg_locatehalo110.15.05.0010.0color255);
    
TE_SendToClient(ctid0.0);
    return 
Action:0;
}

public 
Action:StartBeaconT(Handle:timer)
{
    
CreateTimer(2.0StartBeacontid1);
    return 
Action:0;
}

public 
Action:StartBeacon(Handle:timerany:client)
{

    if (!
isFighting || !IsClientInGame(ctid) || !IsClientInGame(tid))
    {
        return 
Action:4;
    }
    new 
redColor[4] = {255,75,75,255};
    new 
blueColor[4] = {75,75,255,255};
    new 
team GetClientTeam(client);
    new 
Float:vec[3] = 0.0;
    
GetClientAbsOrigin(clientvec);
    
vec[2] += 10;
    if (
team == 2)
    {
        
TE_SetupBeamRingPoint(vec10.0g_beaconragiusg_beamspriteg_halosprite0101.010.00.0redColor00);
    }
    else
    {
        if (
team == 3)
        {
            
TE_SetupBeamRingPoint(vec10.0g_beaconragiusg_beamspriteg_halosprite0101.010.00.0blueColor00);
        }
    }
    
TE_SendToAll(0.0);
    
GetClientEyePosition(clientvec);
    if (
IsSoundPrecached(g_beaconsound))
    {
        
EmitAmbientSound(g_beaconsoundvecclient13001.01000.0);
    }
    return 
Action:0;
}

public 
Action:VerifyConditions(Handle:timer)
{
    new 
Handle:warmup FindConVar("sm_warmupround_active");
    if (
warmup)
    {
        if (
GetConVarBool(warmup))
        {
            return 
Action:0;
        }
    }
    if (
g_intermission)
    {
        return 
Action:0;
    }

    if (
ctid && tid)
    {
        return 
Action:0;
    }
    if (
GetClientCount(true) < g_minplayers)
    {
        return 
Action:0;
    }

    if (
IsClientInGame(ctid) && IsPlayerAlive(ctid) && IsClientInGame(tid) && IsPlayerAlive(tid))
    {

        if (
IsFakeClient(ctid) && IsFakeClient(tid))
        {
            if (!
g_isBotFightAllowed)
            {
                return 
Action:0;
            }
        }
        
winner 0;
        
GetClientName(ctidctname32);
        
GetClientName(tidtname32);
        
PrintHintTextToAll("%t""1v1 situation");
        if (
g_forcefight)
        {
            
CreateTimer(0.5DelayFightany:00);
        }
        
SendFightMenus(ctidtid);
    }
    return 
Action:0;
}

public 
Action:DelayFight(Handle:timer)
{
    
StartFight();
    return 
Action:0;
}

public 
OnClientDisconnect(client)
{
    if (!
isFighting)
    {
    }
    if (
ctid == client)
    {
        
winner tid;
        
loser tid;
        
CancelFight();
    }
    else
    {
        if (
tid == client)
        {
            
winner ctid;
            
loser ctid;
            
CancelFight();
        }
    }
}

public 
EventRoundStart(Handle:eventString:name[], bool:dontBroadcast)
{
    if (
g_enabled)
    {

        if (
g_alltalk && g_alltalkenabled)
        {
            
g_alltalkenabled false;
            
SetConVarInt(sv_alltalk0falsefalse);
        }

        if (
g_block && g_blockenabled)
        {
            
g_blockenabled false;
            if (!
sm_noblock)
            {
                
sm_noblock FindConVar("sm_noblock");
            }
            if (
sm_noblock)
            {
                
SetConVarInt(sm_noblock1falsefalse);
            }
            if (!
sm_noblock_nades)
            {
                
sm_noblock_nades FindConVar("sm_noblock_nades");
            }
            if (
sm_noblock_nades)
            {
                
SetConVarInt(sm_noblock_nades1falsefalse);
            }
        }

        if (
g_Cvar_Restrict && g_bSetRestrict && GetConVarBool(g_Cvar_Restrict))
        {
            
SetConVarInt(g_Cvar_Restrict0falsefalse);
            
g_bSetRestrict false;
        }
        if (
isFighting)
        {
            
CancelFight();
        }
        
alivect 0;
        
alivet 0;
        if (
g_bSDKHooksLoaded && g_bOnTakeDamage)
        {
            
SDKUnhook(ctidSDKHookType:2OnTakeDamage);
            
SDKUnhook(tidSDKHookType:2OnTakeDamage);
            
g_bOnTakeDamage false;
        }
        
ctid 0;
        
tid 0;
        
loser 0;
        
bombplanted false;
        
timesrepeated g_countdowntimer;
        
fighttimer g_fighttimer;
        if (
g_iWeaponsArray != -1)
        {
            if (
g_iWeaponsArray)
            {
                
g_iRandomInt GetRandomInt(0g_iWeaponsArray);
                
GetArrayString(g_hWeaponsArrayg_iRandomIntg_sWeaponsArray64);
            }
            
GetArrayString(g_hWeaponsArray0g_sWeaponsArray64);
        }
    }
}

public 
EventWeaponFire(Handle:eventString:name[], bool:dontBroadcast)
{

    if (
g_enabled && isFighting && g_iWeaponsArray != -&& g_bFightRoundAutoSwitch[g_iRandomInt])
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));

        if (
client && IsClientConnected(client) && IsClientInGame(client))
        {
            
decl String:sBuffer[64];
            
GetClientWeapon(clientsBuffer64);
            if (
strcmp(sBufferg_sWeaponsArrayfalse))
            {
            }
            else
            {

                if (
g_iActiveWeapon[client] > && IsValidEdict(g_iActiveWeapon[client]))
                {
                    new 
Handle:hDataPack;
                    
CreateDataTimer(0.11Timer_WeaponFirehDataPack0);
                    
WritePackCell(hDataPackclient);
                }
            }
        }
    }
    return 
0;
}

public 
Action:Timer_WeaponFire(Handle:timerHandle:hDataPack)
{
    
ResetPack(hDataPackfalse);
    new 
client ReadPackCell(hDataPack);

    if (
IsClientConnected(client) && IsClientInGame(client))
    {
        
decl String:sWeapon[64];
        
decl slot;
        if (
IsValidEdict(g_iActiveWeapon[client]))
        {
            
RemovePlayerItem(clientg_iActiveWeapon[client]);
            
RemoveEdict(g_iActiveWeapon[client]);
            
GivePlayerItem(clientg_sWeaponsArray0);
        }
        
strcopy(sWeapon64g_sWeaponsArray);
        
ReplaceString(sWeapon64"weapon_"""true);
        if (
GetTrieValue(g_WeaponSlotssWeaponslot))
        {
            
g_iActiveWeapon[client] = GetPlayerWeaponSlot(clientslot);
        }
    }
    return 
Action:4;
}

public 
EventWeaponZoom(Handle:eventString:name[], bool:dontBroadcast)
{

    if (
g_enabled && isFighting && g_iWeaponsArray != -&& g_bFightRoundNoZoom[g_iRandomInt])
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));

        if (
client && IsClientConnected(client) && IsClientInGame(client))
        {
            new 
weapon GetPlayerWeaponSlot(client0);

            if (
weapon && IsValidEdict(weapon))
            {
                
RemovePlayerItem(clientweapon);
                
RemoveEdict(weapon);
                
CreateTimer(0.1Timer_GiveWeaponclient0);
                
PrintHintText(client"%t""zoom is disabled");
            }
        }
    }
    return 
0;
}

public 
Action:Timer_GiveWeapon(Handle:timerany:client)
{

    if (
isFighting && IsClientConnected(client) && IsClientInGame(client) && IsPlayerAlive(client))
    {
        
GivePlayerItem(clientg_sWeaponsArray0);
    }
    return 
Action:4;
}

public 
EventBombPlanted(Handle:eventString:name[], bool:dontBroadcast)
{
    if (
g_enabled)
    {
        
bombplanted true;
    }
    return 
0;
}

public 
Action:EventItemPickup(Handle:eventString:name[], bool:dontBroadcast)
{

    if (!
g_enabled || !isFighting)
    {
        return 
Action:0;
    }
    new 
clientid GetClientOfUserId(GetEventInt(event"userid"));

    if (
clientid && IsClientConnected(clientid) && IsClientInGame(clientid) && IsPlayerAlive(clientid))
    {

        if (
ctid != clientid && tid != clientid)
        {
            new 
String:item[64];
            
GetEventString(event"item"item64);
            if (
g_iWeaponsArray == -1)
            {
                if (!
StrEqual(item"knife"false))
                {
                     
FakeClientCommand(clientid"use weapon_knife");
                     new 
Handle:pack CreateDataPack();
                        
WritePackCell(packclientid);
                     
WritePackString(packitem);
                        
CreateTimer(0.1DelayWeaponpack);
                }
            }
            else
            {
                
decl String:sBuffer[64];
                
decl slot;
                
Format(sBuffer64"weapon_%s"item);
                if (
StrEqual(sBufferg_sWeaponsArrayfalse))
                {
                    
strcopy(sBuffer64g_sWeaponsArray);
                    
ReplaceString(sBuffer64"weapon_"""true);
                    if (
GetTrieValue(g_WeaponSlotssBufferslot))
                    {
                        
g_iActiveWeapon[clientid] = GetPlayerWeaponSlot(clientidslot);
                    }
                }
                else
                {
                    
Format(sBuffer64"use %s"g_sWeaponsArray);
                    
FakeClientCommand(clientidsBuffer);
                    new 
Handle:pack CreateDataPack();
                    
WritePackCell(packclientid);
                    
WritePackString(packitem);
                    
CreateTimer(0.1DelayWeaponpack0);
                }
            }
        }
    }
    return 
Action:0;
}

public 
EventPlayerDeath(Handle:eventString:name[], bool:dontBroadcast)
{
    
alivect 0;
    
alivet 0;

    if (
g_enabled && isFighting)
    {
        
loser GetClientOfUserId(GetEventInt(event"userid"));

        if (
ctid != loser && tid != loser)
        {
            
winner GetClientOfUserId(GetEventInt(event"attacker"));
            if (
g_iWeaponsArray != -1)
            {

                if (
loser && IsClientConnected(loser) && IsClientInGame(loser) && g_iActiveWeapon[loser] > && IsValidEdict(g_iActiveWeapon[loser]) && IsValidEntity(g_iActiveWeapon[loser]))
                {
                    
RemovePlayerItem(loserg_iActiveWeapon[loser]);
                    
RemoveEdict(g_iActiveWeapon[loser]);
                }

                if (
winner && IsClientConnected(winner) && IsClientInGame(winner) && g_iActiveWeapon[winner] > && IsValidEdict(g_iActiveWeapon[winner]) && IsValidEntity(g_iActiveWeapon[winner]))
                {
                    
RemovePlayerItem(winnerg_iActiveWeapon[winner]);
                    
RemoveEdict(g_iActiveWeapon[winner]);
                }
            }

            if (
loser != winner && winner)
            {
                if (
g_losereffects)
                {
                    
CreateTimer(0.4DissolveRagdollloser0);
                }
                
g_winnerid winner;
                
GetClientName(winnerwinnername32);
                if (
g_showWinner)
                {
                    if (
g_showWinner == 1)
                    {
                        new 
String:msg[192];
                        new 
1;
                        while (
<= MaxClients)
                        {

                            if (
IsClientConnected(i) && IsClientInGame(i))
                            {
                                
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'winnername'\x04'"has won"i);
                                
PrintMsg(iwinnermsg);
                            }
                            
i++;
                        }
                    }
                }
                else
                {
                    new 
team GetClientTeam(winner);
                    
decl r;
                    new 
var6;
                    if (
team == 2)
                    {
                        
var6 255;
                    }
                    else
                    {
                        
var6 0;
                    }
                    
var6;
                    
decl g;
                    new 
var7;
                    if (
team == 3)
                    {
                        
var7 128;
                    }
                    else
                    {
                        if (
team == 2)
                        {
                            
var7 0;
                        }
                        
var7 255;
                    }
                    
var7;
                    
decl b;
                    new 
var8;
                    if (
team == 3)
                    {
                        
var8 255;
                    }
                    else
                    {
                        
var8 0;
                    }
                    
var8;
                    
decl Handle:hMsg;
                    
decl String:Buffer[64];
                    new 
1;
                    while (
<= MaxClients)
                    {

                        if (
IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i))
                        {
                            
hMsg CreateKeyValues("msg""""");
                            
Format(Buffer64"%s %T"winnername"has won"i);
                            
KvSetString(hMsg"title"Buffer);
                            
KvSetColor(hMsg"color"rgb255);
                            
KvSetNum(hMsg"level"0);
                            
KvSetNum(hMsg"time"10);
                            
CreateDialog(ihMsgDialogType:0);
                            
CloseHandle(hMsg);
                        }
                        
i++;
                    }
                }
                if (
g_winnereffects)
                {
                    
WinnerEffects();
                }
                
CancelFight();
            }
            if (
loser == ctid)
            {
                
winner tid;
                
CancelFight();
            }
            if (
loser == tid)
            {
                
winner ctid;
                
CancelFight();
            }
        }
    }
    else
    {

        if (
g_enabled && !isFighting)
        {
            new 
1;
            while (
<= MaxClients)
            {
                new 
team;

                if (
IsClientInGame(i) && IsPlayerAlive(i))
                {
                    
team GetClientTeam(i);
                    if (
team == 3)
                    {
                        
ctid i;
                        
alivect += 1;
                    }
                    if (
team == 2)
                    {
                        
tid i;
                        
alivet += 1;
                    }
                }
                
i++;
            }

            if (
alivect == && alivet == && !bombplanted)
            {
                
CreateTimer(0.5VerifyConditionsany:00);
            }
        }
    }
    return 
0;
}

public 
EventPlayerSpawn(Handle:eventString:name[], bool:dontBroadcast)
{
    if (
g_enabled)
    {
        new 
client GetClientOfUserId(GetEventInt(event"userid"));

        if (
client && IsClientInGame(client))
        {
            if (
isFighting)
            {
                
CreateTimer(0.1KillPlayerclient0);
            }
            if (
g_winnerid == client)
            {

                if (
g_winnerhealth || g_winnermoney || g_winnerspeed 0.0)
                {
                    new 
String:buffer[256];
                    
Format(buffer256"%T""Items won"client);
                    
StrCat(itemswon256buffer);
                    if (
g_winnerhealth)
                    {
                        
SetEntData(clientg_iHealthg_winnerhealth4true);
                        
Format(buffer256"\n%T: %i""Health"clientg_winnerhealth);
                        
StrCat(itemswon256buffer);
                    }
                    if (
g_winnermoney)
                    {
                        new 
totalmoney GetEntData(clientg_iAccount4) + g_winnermoney;
                        
SetEntData(clientg_iAccounttotalmoney4true);
                        
Format(buffer256"\n%T: $%i""Money"clientg_winnermoney);
                        
StrCat(itemswon256buffer);
                    }
                    if (
g_winnerspeed 0.0)
                    {
                        
SetEntDataFloat(clientg_iSpeedg_winnerspeedtrue);
                        
Format(buffer256"\n%T: %.2fx""Speed"clientg_winnerspeed);
                        
StrCat(itemswon256buffer);
                    }
                    
CreateTimer(1.0ItemsWonclient1);
                    
g_winnerid 0;
                }
            }
        }
    }
    return 
0;
}


public 
Action:DissolveRagdoll(Handle:timerany:client)
{

    if (
IsClientConnected(client) && IsClientInGame(client) && !IsPlayerAlive(client) && IsValidEntity(client))
    {
        new 
ragdoll GetEntPropEnt(clientPropType:0"m_hRagdoll"0);
        if (
ragdoll)
        {
            return 
Action:0;
        }
        new 
String:dname[32];
        
Format(dname32"dis_%i"client);
        new 
entid CreateEntityByName("env_entity_dissolver", -1);
        if (
entid)
        {
            
DispatchKeyValue(ragdoll"targetname"dname);
            
DispatchKeyValue(entid"dissolvetype""0");
            
DispatchKeyValue(entid"target"dname);
            
AcceptEntityInput(entid"Dissolve", -1, -10);
            
AcceptEntityInput(entid"kill", -1, -10);
        }
    }
    return 
Action:0;
}

public 
SendFightMenus(ctt)
{
    
ctagree = -1;
    
tagree = -1;
    new 
String:msg[192];

    if (
IsFakeClient(ct) || g_fightPrefs[ct] == 1)
    {
        new 
1;
        while (
<= MaxClients)
        {

            if (
IsClientConnected(i) && IsClientInGame(i))
            {
                
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'ctname'\x04'"Player agrees"i);
                
PrintMsg(ictmsg);
            }
            
i++;
        }
        
ctagree 1;
    }
    else
    {
        if (
g_fightPrefs[ct] == -1)
        {
            new 
1;
            while (
<= MaxClients)
            {

                if (
IsClientConnected(i) && IsClientInGame(i))
                {
                    
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'ctname'\x04'"Player disagrees"i);
                    
PrintMsg(ictmsg);
                }
                
i++;
            }
            
ctagree 0;
            if (
IsSoundPrecached(g_declinesound))
            {
                
EmitSoundToAll(g_declinesound, -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
            }
        }
        
SendKnifeMenu(ct);
    }

    if (
IsFakeClient(t) || g_fightPrefs[t] == 1)
    {
        new 
1;
        while (
<= MaxClients)
        {

            if (
IsClientConnected(i) && IsClientInGame(i))
            {
                
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'tname'\x04'"Player agrees"i);
                
PrintMsg(itmsg);
            }
            
i++;
        }
        
tagree 1;
    }
    else
    {
        if (
g_fightPrefs[t] == -1)
        {
            new 
1;
            while (
<= MaxClients)
            {

                if (
IsClientConnected(i) && IsClientInGame(i))
                {
                    
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'tname'\x04'"Player disagrees"i);
                    
PrintMsg(itmsg);
                }
                
i++;
            }
            
tagree 0;
            
EmitSoundToAll(g_declinesound, -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
        }
        
SendKnifeMenu(t);
    }

    if (
ctagree == && tagree == 1)
    {
        new 
1;
        while (
<= MaxClients)
        {

            if (
IsClientConnected(i) && IsClientInGame(i))
            {
                
Format(msg192"%c[%c%T%c] %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x04'"Both agree"i);
                
PrintMsg(i0msg);
            }
            
i++;
        }
        
CreateTimer(0.5DelayFightany:00);
    }
    return 
0;
}

public 
SendKnifeMenu(client)
{
    new 
String:sBuffer[128];
    new 
Handle:panel CreatePanel(Handle:0);
    
Format(sBuffer128"%T""Menu title"client);
    
SetPanelTitle(panelsBufferfalse);
    
DrawPanelItem(panel" "10);
    
Format(sBuffer128"%T""Question"client);
    
DrawPanelText(panelsBuffer);
    
DrawPanelText(panel"-----------------------------");
    
Format(sBuffer128"%T""Yes option"client);
    
DrawPanelItem(panelsBuffer0);
    
Format(sBuffer128"%T""No option"client);
    
DrawPanelItem(panelsBuffer0);
    
DrawPanelText(panel"-----------------------------");
    
SendPanelToClient(panelclientPanelHandler15);
    
CloseHandle(panel);
    return 
0;
}

public 
PanelHandler(Handle:menuMenuAction:actionclientitem)
{
    new 
String:msg[192];
    if (
action == MenuAction:4)
    {

        if (
item == && client)
        {

            if (
GetClientTeam(client) == && ctid == client && IsClientInGame(tid) && IsPlayerAlive(tid))
            {
                new 
1;
                while (
<= MaxClients)
                {

                    if (
IsClientConnected(i) && IsClientInGame(i))
                    {
                        
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'ctname'\x04'"Player agrees"i);
                        
PrintMsg(iclientmsg);
                    }
                    
i++;
                }
                
ctagree 1;
            }
            else
            {

                if (
GetClientTeam(client) == && tid == client && IsClientInGame(ctid) && IsPlayerAlive(ctid))
                {
                    new 
1;
                    while (
<= MaxClients)
                    {

                        if (
IsClientConnected(i) && IsClientInGame(i))
                        {
                            
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'tname'\x04'"Player agrees"i);
                            
PrintMsg(iclientmsg);
                        }
                        
i++;
                    }
                    
tagree 1;
                }
            }
        }
        else
        {

            if (
item == && client)
            {

                if (
GetClientTeam(client) == && ctid == client && IsClientInGame(tid) && IsPlayerAlive(tid))
                {
                    new 
1;
                    while (
<= MaxClients)
                    {

                        if (
IsClientConnected(i) && IsClientInGame(i))
                        {
                            
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'ctname'\x04'"Player disagrees"i);
                            
PrintMsg(iclientmsg);
                        }
                        
i++;
                    }
                    
ctagree 0;
                    
EmitSoundToAll(g_declinesound, -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
                }

                if (
GetClientTeam(client) == && tid == client && IsClientInGame(ctid) && IsPlayerAlive(ctid))
                {
                    new 
1;
                    while (
<= MaxClients)
                    {

                        if (
IsClientConnected(i) && IsClientInGame(i))
                        {
                            
Format(msg192"%c[%c%T%c] %c%s %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x03'tname'\x04'"Player disagrees"i);
                            
PrintMsg(iclientmsg);
                        }
                        
i++;
                    }
                    
tagree 0;
                    
EmitSoundToAll(g_declinesound, -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
                }
            }
        }
    }
    else
    {
        if (
action == MenuAction:8)
        {

            if (
IsClientInGame(client) && IsPlayerAlive(client))
            {
                
Format(msg192"%c[%c%T%c] %c%T"'\x04''\x01'"Weapon Fight"client'\x04''\x04'"Restore fight menu"client);
                
PrintMsg(client0msg);
            }
        }
    }

    if (
ctagree == && tagree == 1)
    {
        new 
1;
        while (
<= MaxClients)
        {

            if (
IsClientConnected(i) && IsClientInGame(i))
            {
                
Format(msg192"%c[%c%T%c] %c%T"'\x04''\x01'"Weapon Fight"i'\x04''\x04'"Both agree"i);
                
PrintMsg(i0msg);
            }
            
i++;
        }
        
StartFight();
    }
    return 
0;
}

public 
Lightning()
{

    if (!
IsClientInGame(winner) || !IsPlayerAlive(winner))
    {
        return 
0;
    }
    new 
Float:playerpos[3] = 0.0;
    
GetClientAbsOrigin(winnerplayerpos);
    new 
Float:toppos[3] = 0.0;
    
toppos[0] = playerpos[0];
    
toppos[1] = playerpos[1];
    
toppos[2] = playerpos[2] + 1000;
    new 
lightningcolor[4];
    
lightningcolor[0] = 255;
    
lightningcolor[1] = 255;
    
lightningcolor[2] = 255;
    
lightningcolor[3] = 255;
    new 
Float:lightninglife 0.1;
    new 
Float:lightningwidth 40.0;
    new 
Float:lightningendwidth 10.0;
    new 
lightningstartframe;
    new 
lightningframerate 20;
    new 
lightningfadelength 1;
    new 
Float:lightningamplitude 20.0;
    new 
lightningspeed 250;
    
TE_SetupBeamPoints(topposplayerposg_lightningg_lightninglightningstartframelightningframeratelightninglifelightningwidthlightningendwidthlightningfadelengthlightningamplitudelightningcolorlightningspeed);
    
TE_SendToAll(0.0);
    return 
0;
}

public 
RemoveWeapon(clientString:weapon[])
{
    new 
slot;
    new 
curr_weapon;
    
GetTrieValue(g_WeaponSlotsweaponslot);
    
curr_weapon GetPlayerWeaponSlot(clientslot);

    if (!
client || !IsValidEntity(curr_weapon))
    {
        return 
0;
    }
    
RemovePlayerItem(clientcurr_weapon);
    return 
0;
}

public 
OnClientPutInServer(client)
{
    
g_soundPrefs[client] = GetConVarInt(g_Cvar_SoundPrefDefault);
    
g_fightPrefs[client] = 0;
    if (!
IsFakeClient(client))
    {
        if (
AreClientCookiesCached(client))
        {
            
loadClientCookies(client);
        }
    }

}

public 
OnClientCookiesCached(client)
{

    if (
IsClientInGame(client) && !IsFakeClient(client))
    {
        
loadClientCookies(client);
    }

}

public 
loadClientCookies(client)
{
    
decl String:buffer[8];
    
GetClientCookie(clientg_Cookie_SoundPrefbuffer5);
    if (!
StrEqual(buffer""true))
    {
        
g_soundPrefs[client] = StringToInt(buffer10);
    }
    
GetClientCookie(clientg_Cookie_FightPrefbuffer5);
    if (!
StrEqual(buffer""true))
    {
        
g_fightPrefs[client] = StringToInt(buffer10);
    }
    return 
0;
}

public 
MenuHandlerKnifeFight(Handle:menuMenuAction:actionclientitem)
{
    if (
action == MenuAction:4)
    {
        if (
item)
        {
            if (
item == 1)
            {

                if (!
isFighting && (client != tid && client != ctid) && alivect == && alivet == && GetClientCount(true) >= g_minplayers)
                {
                    
SendKnifeMenu(client);
                }
                else
                {
                    
MenuKnifeFight(client0);
                }
            }

            if (
item == || item == 3)
            {

                if ((
item == && g_fightPrefs[client] == 1) || (item == && g_fightPrefs[client] == -1))
                {
                    
g_fightPrefs[client] = 0;
                }
                else
                {
                    new 
var8;
                    if (
item == 2)
                    {
                        
var8 1;
                    }
                    else
                    {
                        
var8 = -1;
                    }
                    
g_fightPrefs[client] = var8;
                }
                
decl String:buffer[8];
                
IntToString(g_fightPrefs[client], buffer5);
                
SetClientCookie(clientg_Cookie_FightPrefbuffer);
                
MenuKnifeFight(client0);
            }
        }
        else
        {
            new 
var1;
            if (
g_soundPrefs[client])
            {
                
var1 0;
            }
            else
            {
                
var1 1;
            }
            
g_soundPrefs[client] = var1;
            
decl String:buffer[8];
            
IntToString(g_soundPrefs[client], buffer5);
            
SetClientCookie(clientg_Cookie_SoundPrefbuffer);
            
MenuKnifeFight(client0);
        }
    }
    else
    {
        if (
action == MenuAction:16)
        {
            
CloseHandle(menu);
        }
    }
    return 
0;
}

public 
Action:MenuKnifeFight(clientargs)
{
    new 
Handle:menu CreateMenu(MenuHandlerKnifeFightMenuAction:28);
    
decl String:sBuffer[128];
    
Format(sBuffer128"%T""WeaponFight settings"client);
    
SetMenuTitle(menusBuffer);
    if (
g_soundPrefs[client])
    {
        
Format(sBuffer128"%T %T""Play fight songs"client"Selected"client);
    }
    else
    {
        
Format(sBuffer128"%T %T""Play fight songs"client"NotSelected"client);
    }
    
AddMenuItem(menu"Play fight songs"sBuffer0);
    
Format(sBuffer128"%T""Show fight panel"client);
    new 
var3;
    if (!
isFighting && (client != tid && client != ctid) && alivect == && alivet == && GetClientCount(true) >= g_minplayers)
    {
        
var3 0;
    }
    else
    {
        
var3 1;
    }
    
AddMenuItem(menu"Show fight panel"sBuffervar3);
    new 
var4;
    if (
g_fightPrefs[client] == 1)
    {
        
var4 12332;
    }
    else
    {
        
var4 12344;
    }
    
Format(sBuffer128"%T %T""Always agree to weapon fight"clientvar4client);
    
AddMenuItem(menu"Always agree to weapon fight"sBuffer0);
    new 
var5;
    if (
g_fightPrefs[client] == -1)
    {
        
var5 12428;
    }
    else
    {
        
var5 12440;
    }
    
Format(sBuffer128"%T %T""Always disagree to weapon fight"clientvar5client);
    
AddMenuItem(menu"Always disagree to weapon fight"sBuffer0);
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclient32);
    return 
Action:3;
}

public 
RemoveAllWeapons()
{
    new 
maxent GetMaxEntities();
    new 
String:weapon[64];
    new 
MaxClients;
    while (
maxent)
    {

        if (
IsValidEdict(i) && IsValidEntity(i) && GetEntDataEnt2(ig_WeaponParent) == -1)
        {
            
GetEdictClassname(iweapon64);

            if (
StrContains(weapon"weapon_"true) == -&& StrEqual(weapon"hostage_entity"true) && StrContains(weapon"item_"true) == -1)
            {
                
RemoveEdict(i);
            }
        }
        
i++;
    }
    return 
0;
}

public 
ParsFile(String:file[], bool:sound)
{
    new 
String:sBuffer[256];
    new 
iBuffer;
    
BuildPath(PathType:0sBuffer256"configs/%s"file);
    new 
Handle:hFile OpenFile(sBuffer"r");
    if (
hFile)
    {
        while (!
IsEndOfFile(hFile))
        {
            if (
ReadFileLine(hFilesBuffer256))
            {
                
iBuffer StrContains(sBuffer"//"true);
                if (
iBuffer != -1)
                {
                    
sBuffer[iBuffer] = 0;
                }
                
iBuffer StrContains(sBuffer"#"true);
                if (
iBuffer != -1)
                {
                    
sBuffer[iBuffer] = 0;
                }
                
iBuffer StrContains(sBuffer";"true);
                if (
iBuffer != -1)
                {
                    
sBuffer[iBuffer] = 0;
                }
                
TrimString(sBuffer);
                if (
sBuffer[0])
                {
                    if (
sound)
                    {
                        if (
StrContains(sBuffer"=NoZoom"true) != -1)
                        {
                            
ReplaceString(sBuffer256"=NoZoom"""true);
                            if (
StrContains(sBuffer"=AutoSwitch"true) != -1)
                            {
                                
ReplaceString(sBuffer256"=AutoSwitch"""true);
                                if (
ParsWeapon(sBuffer))
                                {
                                    
g_bFightRoundNoZoom[g_iWeaponsArray] = 1;
                                    
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 1;
                                }
                            }
                            else
                            {
                                if (
StrContains(sBuffer"=autoswitch"true) != -1)
                                {
                                    
ReplaceString(sBuffer256"=autoswitch"""true);
                                    if (
ParsWeapon(sBuffer))
                                    {
                                        
g_bFightRoundNoZoom[g_iWeaponsArray] = 1;
                                        
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 1;
                                    }
                                }
                                if (
ParsWeapon(sBuffer))
                                {
                                    
g_bFightRoundNoZoom[g_iWeaponsArray] = 1;
                                    
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 0;
                                }
                            }
                        }
                        else
                        {
                            if (
StrContains(sBuffer"=nozoom"true) != -1)
                            {
                                
ReplaceString(sBuffer256"=nozoom"""true);
                                if (
StrContains(sBuffer"=AutoSwitch"true) != -1)
                                {
                                    
ReplaceString(sBuffer256"=AutoSwitch"""true);
                                    if (
ParsWeapon(sBuffer))
                                    {
                                        
g_bFightRoundNoZoom[g_iWeaponsArray] = 1;
                                        
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 1;
                                    }
                                }
                                else
                                {
                                    if (
StrContains(sBuffer"=autoswitch"true) != -1)
                                    {
                                        
ReplaceString(sBuffer256"=autoswitch"""true);
                                        if (
ParsWeapon(sBuffer))
                                        {
                                            
g_bFightRoundNoZoom[g_iWeaponsArray] = 1;
                                            
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 1;
                                        }
                                    }
                                    if (
ParsWeapon(sBuffer))
                                    {
                                        
g_bFightRoundNoZoom[g_iWeaponsArray] = 1;
                                        
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 0;
                                    }
                                }
                            }
                            if (
StrContains(sBuffer"=AutoSwitch"true) != -1)
                            {
                                
ReplaceString(sBuffer256"=AutoSwitch"""true);
                                if (
ParsWeapon(sBuffer))
                                {
                                    
g_bFightRoundNoZoom[g_iWeaponsArray] = 0;
                                    
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 1;
                                }
                            }
                            if (
StrContains(sBuffer"=autoswitch"true) != -1)
                            {
                                
ReplaceString(sBuffer256"=autoswitch"""true);
                                if (
ParsWeapon(sBuffer))
                                {
                                    
g_bFightRoundNoZoom[g_iWeaponsArray] = 0;
                                    
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 1;
                                }
                            }
                            if (
ParsWeapon(sBuffer))
                            {
                                
g_bFightRoundNoZoom[g_iWeaponsArray] = 0;
                                
g_bFightRoundAutoSwitch[g_iWeaponsArray] = 0;
                            }
                        }
                    }
                    else
                    {
                        if (
PrecacheSound(sBuffertrue))
                        {
                            
songsfound += 1;
                            
PushArrayString(g_hSoundsArraysBuffer);
                            
Format(sBuffer256"sound/%s"sBuffer);
                            
AddFileToDownloadsTable(sBuffer);
                        }
                        
LogError("[WeaponFight] Could not pre-cache sound: %s"sBuffer);
                    }
                }
            }
        }
        
CloseHandle(hFile);
    }
    return 
0;
}

public 
bool:ParsWeapon(String:weapon[])
{
    
decl String:sBuffer[64];
    
decl iBuffer;

    if (
GetTrieValue(g_hWeaponsTrieweaponiBuffer) && g_iWeaponsArray 32)
    {
        
Format(sBuffer64"weapon_%s"weapon);
        
PushArrayString(g_hWeaponsArraysBuffer);
        
g_iWeaponsArray += 1;
        return 
true;
    }
    return 
false;
}

public 
PrintMsg(clientauthorString:message[])
{
    new 
Handle:buffer StartMessageOne("SayText2"client0);
    
BfWriteByte(bufferauthor);
    
BfWriteByte(buffer1);
    
BfWriteString(buffermessage);
    
EndMessage();
    return 
0;
}

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3], damagecustom)
{

    if (
attacker && attacker <= MaxClients && attacker == victim)
    {
        return 
Action:3;
    }
    return 
Action:0;

plz help me

SOLVED:
This error become because this plugin is compile in sm 1.8 and i am using 1.7 than this error comes.
i update my sourcemod version to 1.10 and its works error gone
Attached Files
File Type: sp Get Plugin or Get Source (weaponfight.sp - 40 views - 57.9 KB)

Last edited by born for gaming; 10-02-2020 at 11:48.
born for gaming is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 09-25-2020 , 20:08   Re: Native "DataPack.DataPack" was not found
Reply With Quote #2

What SourceMod version is your server running?

You should be on version 1.10

Last edited by headline; 09-25-2020 at 20:08.
headline is offline
born for gaming
Member
Join Date: Aug 2019
Location: Pakistan
Old 10-02-2020 , 11:57   Re: Native "DataPack.DataPack" was not found
Reply With Quote #3

Quote:
Originally Posted by headline View Post
What SourceMod version is your server running?

You should be on version 1.10
Thanks for reply my problem fixed
born for gaming 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 16:37.


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