AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Unscope Snipers (https://forums.alliedmods.net/showthread.php?t=136940)

Costin83 08-31-2010 17:24

Unscope Snipers
 
1 Attachment(s)
A simple plugin that unscopes AWP and SCOUT after shooting to exempt you from the effort to fast switch from your primary weapon to your pistol and vice versa avoiding ending up with a scoped weapon after shooting.

Credits: ConnorMcLeod Arkshine Exolent[jNr]

Updated - Please redownload (better version available)

Arkshine 08-31-2010 17:40

Re: Unscope Snipers
 
I've told you new id = blabla, directly... -_-

Costin83 08-31-2010 17:51

Re: Unscope Snipers
 
Quote:

Originally Posted by Arkshine (Post 1287464)
I've told you new id = blabla, directly... -_-

I'm really dumb... Shoot me! (where I'm from, you could easily confuse "directly" with "Yes, that's exactly what I meant" so there was the confusion... :|)

Updated...

Arkshine 08-31-2010 18:36

Re: Unscope Snipers
 
Actually, looking at the AWP weapon, I would prefer to use m_bResumeZoom set to 0 to no allow the zoom to back.

Costin83 08-31-2010 18:56

Re: Unscope Snipers
 
Quote:

Originally Posted by Arkshine (Post 1287501)
Actually, looking at the AWP weapon, I would prefer to use m_bResumeZoom set to 0 to no allow the zoom to back.

Why !?! :shock:

BTW: Is that .cpp from your CS 1.6 SDK ?

Arkshine 08-31-2010 19:29

Re: Unscope Snipers
 
Yes.

About the plugin, you hook as pre, so, when you will shoot while zooming you will add some spread ( see the start of function ). So, you should hook as post. Now, about the offset, there is not really a difference. Just, I prefer to trigger something and letting the game doing its job rather than forcing when no need. Here you have an offset m_bResumeZoom which is meant specifically for what you need. The game will check that at the right time to remove the zoom, so just turn off the offset.

Costin83 08-31-2010 20:17

Re: Unscope Snipers
 
Quote:

Originally Posted by Arkshine (Post 1287555)
Yes.

About the plugin, you hook as pre, so, when you will shoot while zooming you will add some spread ( see the start of function ). So, you should hook as post. Now, about the offset, there is not really a difference. Just, I prefer to trigger something and letting the game doing its job rather than forcing when no need. Here you have an offset m_bResumeZoom which is meant specifically for what you need. The game will check that at the right time to remove the zoom, so just turn off the offset.

Now I understand what you're saying but I don't really know how to use that offset.... :|

Are you talking about: set_pdata_int(_index,_Offset,_Value,_linuxdif f=5); ?
And if so... I don't really have a clue about how to use it...
Like: set_pdata_int(iEnt,185,0,_) ?

Edit: where can I find the offset number for
m_bResumeZoom ? I can't find it anywhere... :|

Ok, so I think it should be something like this ?

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "UnZoom"
#define VERSION "0.1"
#define AUTHOR "Connor/Arkshine/Exolent/80T"

new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

#define m_pPlayer    41
#define m_iFOV        363
#define m_bResumeZoom    110

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_awp""Sniper_UnScope")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_scout""Sniper_UnScope")
}

public 
Sniper_UnScopeiEnt )
{
    new 
id get_pdata_cbase(iEntm_pPlayer4)

    if( 
get_pdata_int(idm_iFOV5) < 90 )
    {
        
set_pdata_int(iEntm_bResumeZoom05)
        
ExecuteHamBHam_Player_ResetMaxSpeedid );
    }


But it's not working... :|

Exolent[jNr] 08-31-2010 23:41

Re: Unscope Snipers
 
Don't turn your plugin submission topic into a scripting help topic.

ConnorMcLeod 09-01-2010 01:46

Re: Unscope Snipers
 
You doesn't seem to understand how thoe whole thing is working, take the time to understand and then update the plugin, also, hook primattack POST should be better.

Arkshine 09-01-2010 09:25

Re: Unscope Snipers
 
Quote:

But it's not working...
Because it's a player's offset. I should have said it before.


All times are GMT -4. The time now is 11:02.

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