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

Solved [REQ/HELP] Quick & No Scope Modification


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dom_1
Junior Member
Join Date: Apr 2018
Location: Maharashtra
Old 04-03-2018 , 06:42   [REQ/HELP] Quick & No Scope Modification
Reply With Quote #1

Help Me Guyzzz

I Wanna Only UnZoom Shot Plugin

1). In This Plugin Add Dhud Messege on Left.
2). Add Sound For No Scope Shot.
3). Want Only UnZoom Shot.
4). Dont Add Quick Zoom Shot Dhud.

-=||DOM*||=- Here

Last edited by Dom_1; 04-04-2018 at 07:47. Reason: Word Capitalization
Dom_1 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 04-03-2018 , 11:07   Re: [REQ/HELP] Quick & No Scope Modification
Reply With Quote #2

Try :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define MAX_PLAYERS 32

enum _:CvarsSettings
{
    
PluginEnabled,
    
DisplayMessageType,
    
PluginPrefix
}

new 
pCvars[CvarsSettings]

new 
szPluginPrefix[25]

enum _:PlayerScopeData
{
    
Float:ScopeTime,
    
ScopeType
}

new 
ScopeData[MAX_PLAYERS+1][PlayerScopeData]

new 
gMsgSync
new MsgSayText

new PluginForwardQuickPluginForwardNoScopeg_iReturn

public plugin_init() 
{
    new const 
PluginVersion[] = "1.2"
    
register_plugin("Quick and No Scope Detector"PluginVersion"EFFx")
    
    
gMsgSync CreateHudSyncObj()
    
    
pCvars[PluginEnabled] = register_cvar("qsd_enabled","1")
    
pCvars[DisplayMessageType] = register_cvar("qsd_messagetype","hud")
    
pCvars[PluginPrefix] = register_cvar("qsd_chatprefix","[Quick&NoScopeDetector]")

    
PluginForwardQuick CreateMultiForward("client_NoScoped"ET_STOPFP_CELLFP_CELLFP_CELL)
    
PluginForwardNoScope CreateMultiForward("client_QuickScoped"ET_STOPFP_CELLFP_CELLFP_CELL)
    
    if(!
PluginForwardQuick)
    {
        
log_amx("client_NoScoped forward is not used by any other plugin.")
    }
    
    if(!
PluginForwardNoScope)
    {
        
log_amx("client_QuickScoped forward is not used by any other plugin.")
    }
    
    
register_event("DeathMsg","checkQuickScopeKill","a","1>0""4=scout","4=sg550""4=awp""4=g3sg1")
    
register_event("CurWeapon","fw_EvCurWeapon","b","1=1","2=3","2=13""2=18""2=24")
    
register_event("SetFOV","Zoom","b","1<90")
    
    
MsgSayText get_user_msgid("SayText")
}
public 
plugin_prechache() precache_generic("sound/scoped.mp3")

public 
plugin_natives()
{
    
register_library("quicknoscoped")
}

public 
plugin_end()
{
    
DestroyForward(PluginForwardQuick)
    
DestroyForward(PluginForwardNoScope)
}

public 
Zoom(id)
{
    if(
is_user_alive(id))
    {
        
ScopeData[id][ScopeTime] = _:get_gametime()
    }
}
public 
fw_EvCurWeapon(id)
{
    
ScopeData[id][ScopeType] = cs_get_user_zoom(id)
}
public 
checkQuickScopeKill()
{
    if(!
get_pcvar_num(pCvars[PluginEnabled]))
        return
    
    new 
KillerName[32],VictimName[32],WeaponName[17]
    
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    
    new 
Float:GameTime get_gametime()
    
    new 
bool:bNoScope bool:(ScopeData[iKiller][ScopeType] == CS_SET_NO_ZOOM)
    new 
bool:bQuickScope bool:(GameTime ScopeData[iKiller][ScopeTime] <= 0.20)
    
    if(
bNoScope || bQuickScope)
    {
        
get_user_name(iKiller,KillerName,charsmax(KillerName))
        
get_user_name(iVictim,VictimName,charsmax(VictimName))

        
bNoScope ExecuteForward(PluginForwardNoScopeg_iReturniKilleriVictimget_user_weapon(iKiller)) : ExecuteForward(PluginForwardQuickg_iReturniKilleriVictimget_user_weapon(iKiller))
        
        
read_data(4,WeaponName,charsmax(WeaponName))

        
QSD_ChatMessage 
        

            
"^4%s^1 Holy shit!^4 %s^1 %s^3 %s^1 with his^4 %s"
            
get_pcvar_string(pCvars[PluginPrefix],szPluginPrefix,charsmax(szPluginPrefix)), 
            
szPluginPrefix
            
KillerName
            
bNoScope "just NO SCOPED" "made a^4 QUICK SCOPE^1 on" 
            
VictimName
            
WeaponName 
        
)
        if(
bNoScope)
        {
            
set_hudmessage(random(256), random(256), random(256), 0.040.6711.003.000.100.20, -1);
            
show_hudmessage(0"%s has just No Scoped on %s"KillerNameVictimName);
            
client_cmd(0"mp3 play sound/scoped.mp3")
        }
    }
}
QSD_ChatMessage(const message[],withPrefixRemoved,any:...) 
{
    static 
szMsg[191]
    
vformat(szMsg,charsmax(szMsg),message,3)

    
replace_all(szMsgcharsmax(szMsg),"!g","^4")
    
replace_all(szMsgcharsmax(szMsg),"!y","^1")
    
replace_all(szMsgcharsmax(szMsg),"!t","^3")
    
    new const 
replaceIcons[] = {"^4","^3","^1"}
    
    new 
szMessageType[45]
    
get_pcvar_string(pCvars[DisplayMessageType],szMessageType,charsmax(szMessageType))
    
    switch(
szMessageType[0])
    {
        case 
'H','h':
        {
            for(new 
i;sizeof replaceIcons;i++)
            {
                
replace_all(szMsg,charsmax(szMsg),replaceIcons[i],"")
            }
            
set_hudmessage(0,255,0,-1.0,0.25,1,1.0,5.0)
            
ShowSyncHudMsg(0,gMsgSync,szMsg[withPrefixRemoved])
        }
        case 
'L','l':
        {
            for(new 
i;sizeof replaceIcons;i++)
            {
                
replace_all(szMsg,charsmax(szMsg),replaceIcons[i],"")
            }
            
log_amx(szMsg[withPrefixRemoved])
        }
        default:
        {
            new 
Players[32],iPlayersNum,PlayerID
            get_players
(Players,iPlayersNum,"ch")
                
            for(new 
i;iPlayersNum;i++)
            {
                
PlayerID Players[i]
                
message_begin(MSG_ONE_UNRELIABLE,MsgSayText, .player PlayerID)  
                
write_byte(PlayerID)
                
write_string(szMsg)
                
message_end()
            }
        }
    }

Sound is going to be scoped.mp3 in sound folder !!
( Didn't tested )

Last edited by instinctpt1; 04-03-2018 at 11:08. Reason: php
instinctpt1 is offline
Dom_1
Junior Member
Join Date: Apr 2018
Location: Maharashtra
Old 04-04-2018 , 07:19   Re: [REQ/HELP] Quick & No Scope Modification
Reply With Quote #3

Bro I Wanna Plugin Only For Unzoom Shot
Add Dhud Messege (Not HUD)
Ty
__________________
Dom_1 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 04-05-2018 , 09:08   Re: [REQ/HELP] Quick & No Scope Modification
Reply With Quote #4

Here is for Dhud without flickering :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#if AMXX_VERSION_NUM < 183
    #include <dhudmessage>
#endif

#define MAX_PLAYERS 32

enum _:CvarsSettings
{
    
PluginEnabled,
    
DisplayMessageType,
    
PluginPrefix
}

new 
pCvars[CvarsSettings]

enum _:PlayerScopeData
{
    
Float:ScopeTime,
    
ScopeType
}

new 
ScopeData[MAX_PLAYERS+1][PlayerScopeData]
new 
PluginForwardQuickPluginForwardNoScopeg_iReturn

public plugin_init() 
{
    new const 
PluginVersion[] = "1.2"
    
register_plugin("Quick and No Scope Detector"PluginVersion"EFFx")
    
    
pCvars[PluginEnabled] = register_cvar("qsd_enabled","1")
    
pCvars[DisplayMessageType] = register_cvar("qsd_messagetype","hud")
    
pCvars[PluginPrefix] = register_cvar("qsd_chatprefix","[Quick&NoScopeDetector]")

    
PluginForwardQuick CreateMultiForward("client_NoScoped"ET_STOPFP_CELLFP_CELLFP_CELL)
    
PluginForwardNoScope CreateMultiForward("client_QuickScoped"ET_STOPFP_CELLFP_CELLFP_CELL)
    
    if(!
PluginForwardQuick)
    {
        
log_amx("client_NoScoped forward is not used by any other plugin.")
    }
    
    if(!
PluginForwardNoScope)
    {
        
log_amx("client_QuickScoped forward is not used by any other plugin.")
    }
    
    
register_event("DeathMsg","checkQuickScopeKill","a","1>0""4=scout","4=sg550""4=awp""4=g3sg1")
    
register_event("CurWeapon","fw_EvCurWeapon","b","1=1","2=3","2=13""2=18""2=24")
    
register_event("SetFOV","Zoom","b","1<90")
}
public 
plugin_prechache() precache_generic("sound/scoped.mp3")

public 
plugin_natives()
{
    
register_library("quicknoscoped")
}

public 
plugin_end()
{
    
//DestroyForward(PluginForwardQuick)
    
DestroyForward(PluginForwardNoScope)
}

public 
Zoom(id)
{
    if(
is_user_alive(id))
    {
        
ScopeData[id][ScopeTime] = _:get_gametime()
    }
}
public 
fw_EvCurWeapon(id)
{
    
ScopeData[id][ScopeType] = cs_get_user_zoom(id)
}
public 
checkQuickScopeKill()
{
    if(!
get_pcvar_num(pCvars[PluginEnabled]))
        return
    
    new 
KillerName[32],VictimName[32],WeaponName[17]
    
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    
    new 
bool:bNoScope bool:(ScopeData[iKiller][ScopeType] == CS_SET_NO_ZOOM)
    
    if(
bNoScope)
    {
        
get_user_name(iKiller,KillerName,charsmax(KillerName))
        
get_user_name(iVictim,VictimName,charsmax(VictimName))

        
bNoScope ExecuteForward(PluginForwardNoScopeg_iReturniKilleriVictimget_user_weapon(iKiller)) : ExecuteForward(PluginForwardQuickg_iReturniKilleriVictimget_user_weapon(iKiller))
        
        
read_data(4,WeaponName,charsmax(WeaponName))
        if(
bNoScope)
        {
            
set_dhudmessage(random(256), random(256), random(256), 0.040.6701.003.000.100.20);
            
show_dhudmessage(0"Holy Shit %s has just No Scoped on %s"KillerNameVictimName);
            
client_cmd(0"stop;mp3 play sound/scoped.mp3")
        }
    }

instinctpt1 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-05-2018 , 14:57   Re: [REQ/HELP] Quick & No Scope Modification
Reply With Quote #5

Next time you could ask on the plugin's thread. Also, I edited a bit (I don't tested):

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#if AMXX_VERSION_NUM < 183
#include <dhudmessage>

#define MAX_PLAYERS 32
#endif

new PluginEnabled

enum _
:PlayerScopeData
{
    
Float:ScopeTime,
    
ScopeType
}

new const 
g_szNoScopeSound[] = "noscope/noscope_sound.mp3"

new ScopeData[MAX_PLAYERS+1][PlayerScopeData]
new 
PluginForwardNoScopeg_iReturn

public plugin_init() 
{
    
register_plugin("No Scope Detector""1.2""EFFx")

    
PluginEnabled register_cvar("noscopedetector_enabled","1")
    
    
PluginForwardNoScope CreateMultiForward("client_NoScoped"ET_STOPFP_CELLFP_CELLFP_CELL)

    if(!
PluginForwardNoScope)
    {
        
log_amx("client_QuickScoped forward is not used by any other plugin.")
    }
    
    
register_event("DeathMsg","checkQuickScopeKill","a","1>0""4=scout","4=sg550""4=awp""4=g3sg1")
    
register_event("CurWeapon","fw_EvCurWeapon","b","1=1","2=3","2=13""2=18""2=24")
    
register_event("SetFOV","Zoom","b","1<90")
}

public 
plugin_prechache() 
{
    
precacheSound(g_szNoScopeSound)
}

public 
plugin_natives()
{
    
register_library("quicknoscoped")
}

public 
plugin_end()
{
    
DestroyForward(PluginForwardNoScope)
}

public 
Zoom(id)
{
    if(
is_user_alive(id))
    {
        
ScopeData[id][ScopeTime] = _:get_gametime()
    }
}

public 
fw_EvCurWeapon(id)
{
    
ScopeData[id][ScopeType] = cs_get_user_zoom(id)
}

public 
checkQuickScopeKill()
{
    if(!
PluginEnabled)
        return
    
    new 
KillerName[MAX_PLAYERS],VictimName[MAX_PLAYERS],WeaponName[17]
    new 
iKiller read_data(1), iVictim read_data(2)
    
    if(
ScopeData[iKiller][ScopeType] == CS_SET_NO_ZOOM)
    {
        
get_user_name(iKiller,KillerName,charsmax(KillerName))
        
get_user_name(iVictim,VictimName,charsmax(VictimName))
        
        
ExecuteForward(PluginForwardNoScopeg_iReturniKilleriVictimget_user_weapon(iKiller))
        
read_data(4,WeaponName,charsmax(WeaponName))

        
set_dhudmessage(random(256), random(256), random(256), 0.040.6701.003.000.100.20);
        
show_dhudmessage(0"Holy Shit %s has just No Scoped on %s"KillerNameVictimName);
        
        
soundCmd()
    }
}  

soundCmd()
{
    
client_cmd(0"stopsound")
    
    new 
szPlayCommand[MAX_PLAYERS 2]
    
formatex(szPlayCommandcharsmax(szPlayCommand), isWavFile(g_szNoScopeSound) ? "spk ^"%s^"" "mp3 play ^"sound/%s^""g_szNoScopeSound)
    
client_cmd(0szPlayCommand)
}

precacheSound(const szSound[])
{
    if(!
isWavFile(szSound))
    {
        new 
szSoundMP3[MAX_PLAYERS 2]
        
formatex(szSoundMP3charsmax(szSoundMP3), "sound/%s"szSound)
        
precache_generic(szSoundMP3)
    }
    else
    {
        
precache_sound(szSound)
    }
}

bool:isWavFile(const szFileName[])
{
    return 
bool:(equali(szFileName[strlen(szFileName) - 4], ".wav"))

You can add .mp3 or a .wav sound and the plugin stills precaching it correctly.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 04-05-2018 at 15:02.
EFFx is offline
Dom_1
Junior Member
Join Date: Apr 2018
Location: Maharashtra
Old 04-06-2018 , 07:23   Re: [REQ/HELP] Quick & No Scope Modification
Reply With Quote #6

Ty Sm Instict & EFFx
__________________
Dom_1 is offline
Reply


Thread Tools
Display Modes

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

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

Forum Jump


All times are GMT -4. The time now is 04:39.


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