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

CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-28-2018 , 05:23   CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #1

Hello there, as the title implies, i need a Plugin where you can Zoom with "atack2" mouse right klick like a SG556 or AUG. Is there one?

Thanks
iskenderkebab33 is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 06-28-2018 , 08:33   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #2

normal
SetEntProp(client, Prop_Send, "m_iFOV", 90);

zoomed
SetEntProp(client, Prop_Send, "m_iFOV", 270);
i don't have plugin
supertimor is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-28-2018 , 10:02   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #3

PHP Code:
#include <sourcemod>
#include <sdktools>

bool g_bToggle[MAXPLAYERS 1];

public 
void OnGameFrame()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsValidClient(i))
        {
            if (
GetClientButtons(i) & IN_ATTACK2)
            {
                
g_bToggle[i] = !g_bToggle[i];
                
                if (!
g_bToggle[i])
                {
                    
SetEntProp(iProp_Send"m_iFOV"90);

                    continue;
                }
                
                if (
g_bToggle[i])
                {
                    
SetEntProp(iProp_Send"m_iFOV"270);
                }
            }
        }
    }
}

stock bool IsValidClient(int iClient)
{
    if (!(
iClient <= MaxClients) || !IsClientInGame(iClient) || IsFakeClient(iClient))
    {
        return 
false;
    }
    
    return 
true;

have fun ^^

Last edited by mug1wara; 06-29-2018 at 07:30.
mug1wara is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-28-2018 , 10:13   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #4

Quote:
Originally Posted by mug1wara View Post
PHP Code:
#include <sourcemod>
#include <sdktools>

bool g_bToggle[MAXPLAYERS 1];

public 
void OnGameFrame()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsValidClient(i))
        {
            if (
GetClientButtons(i) & IN_ATTACK2)
            {
                
g_bToggle[i] = !g_bToggle[i];
                
                if (!
g_bToggle[i])
                {
                    continue;
                }
                
                if (
g_bToggle[i])
                {
                    
SetEntProp(iProp_Send"m_iFOV"270);
                }
            }
        }
    }
}

stock bool IsValidClient(int iClient)
{
    if (!(
iClient <= MaxClients) || !IsClientInGame(iClient) || IsFakeClient(iClient))
    {
        return 
false;
    }
    
    return 
true;

have fun ^^
nm. thank you ^^

Last edited by iskenderkebab33; 06-28-2018 at 10:28.
iskenderkebab33 is offline
aykocity
Member
Join Date: Sep 2017
Old 06-28-2018 , 20:02   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #5

thanks
zoom (work)
but
does not close zoom (exit zoom) ? (not work)

Last edited by aykocity; 06-28-2018 at 20:05.
aykocity is offline
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 06-29-2018 , 05:28   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #6

Seems like plugin only have zoom in ( SetEntProp(i, Prop_Send, "m_iFOV", 270); )
but haven't zoom back ( SetEntProp(client, Prop_Send, "m_iFOV", 90); )
waylander3 is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 06-29-2018 , 06:28   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #7

Just try to put fov90 to !gtoggle, where "continue" is
supertimor is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-29-2018 , 07:31   Re: CS:GO Plugin Req. Zoom with Pistol like SG556 or AUG
Reply With Quote #8

Edited code above, try that one. It will prevent from zooming again, but not actually zooming out xD my bad , i'd still use continue; though
mug1wara 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 13:18.


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