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

Realistic Deagle v1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
thEsp
BANNED
Join Date: Aug 2017
Old 02-18-2019 , 05:24   Realistic Deagle v1.2
Reply With Quote #1

Description
A very simple plugin, which zooms/scopes deagle realistically.
Just press the left mouse key (+attack2) and this will activate, also the crosshair will automatically disappear.
SO FAR there's no command or CVar. And it's not restricted.

Changelog
Versions
Attached Files
File Type: zip models.zip (176.2 KB, 159 views)
File Type: sma Get Plugin or Get Source (realisticDeagle.sma - 517 views - 1.7 KB)

Last edited by thEsp; 04-07-2020 at 06:04. Reason: Update
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-18-2019 , 07:40   Re: Realistic Deagle v1.0
Reply With Quote #2

So where's the model? You should definitely mention that it requires a different model in the first post.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 02-18-2019, 07:43
thEsp
This message has been deleted by thEsp.
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-18-2019 , 09:41   Re: Realistic Deagle v1.0
Reply With Quote #3

PHP Code:
public resret(id)
{
    
ret[1]=false

PHP Code:
set_task(0.25,"resret",1
Should be
PHP Code:
public resret(id)
{
    
ret[id]=false

PHP Code:
set_task(0.25,"resret",id
You don't need to use Tempstring, those arguments are optional. You can just use "get_user_weapon(id)". You can also use a variable and store the time using get_gametime() instead of using a task.

Did you make the model? Fun plugin, but the model could use a transition animation when switching between the two different modes.

Last edited by PartialCloning; 02-18-2019 at 09:44.
PartialCloning is offline
thEsp
BANNED
Join Date: Aug 2017
Old 02-18-2019 , 09:52   Re: Realistic Deagle v1.0
Reply With Quote #4

Quote:
Originally Posted by PartialCloning View Post
PHP Code:
public resret(id)
{
    
ret[1]=false

PHP Code:
set_task(0.25,"resret",1
Should be
PHP Code:
public resret(id)
{
    
ret[id]=false

PHP Code:
set_task(0.25,"resret",id
You don't need to use Tempstring, those arguments are optional. You can just use "get_user_weapon(id)". You can also use a variable and store the time using get_gametime() instead of using a task.

Did you make the model? Fun plugin, but the model could use a transition animation when switching between the two different modes.
I just changed the origins of model, yeah would be even better if switch animation was made. I'll think about that, but I can't really do much since IDK how to work with Milkshape 3D properly.
As for the code 'bug' thanks
thEsp is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-18-2019 , 10:02   Re: Realistic Deagle v1.0
Reply With Quote #5

PLUGIN_CONTINUE/HANDLED -> FMRES_IGNORED. http://amxmodx.org/api/fakemeta_const

Edit: Cleaned it up a little and used engine's client_cmdStart.
PHP Code:
#include <amxmodx>
#include <engine>

#define oldDg "models/v_deagle.mdl"
#define newDg "models/v_deagle_z.mdl"

new bool:g_inZoom[33], Float:g_lastZoom[33];
new 
g_HideWeapon;

public 
plugin_init()
{
    
register_plugin("Realistic Deagle""1.0""thEsp");
    
g_HideWeapon get_user_msgid("HideWeapon");
}

public 
plugin_precache()
{
    
precache_model(oldDg);
    
precache_model(newDg);
}

public 
client_cmdStart(id)
{
    if(
g_lastZoom[id] > get_gametime() || !(get_usercmd(usercmd_buttons) & IN_ATTACK2) || get_user_weapon(id) != CSW_DEAGLE)
        return 
PLUGIN_CONTINUE;

    
g_lastZoom[id] = get_gametime() + 0.25;

    if(
g_inZoom[id])
    {
        
entity_set_string(idEV_SZ_viewmodeloldDg);

        
message_begin(MSG_ONEg_HideWeapon_id);
        
write_byte(0<<6);
        
message_end();
    }
    else
    {
        
entity_set_string(idEV_SZ_viewmodelnewDg);

        
message_begin(MSG_ONEg_HideWeapon_id);
        
write_byte(1<<6);
        
message_end();
    }

    
g_inZoom[id] = !g_inZoom[id];
    return 
PLUGIN_CONTINUE;
}

public 
client_disconnect(id)
{
    
g_inZoom[id] = false;
    
g_lastZoom[id] = 0.0;
}

// oh hello there ! 

Last edited by PartialCloning; 02-18-2019 at 10:14.
PartialCloning is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 02-19-2019 , 13:56   Re: Realistic Deagle v1.0
Reply With Quote #6

FM_CmdStart

This plugin will perform better if you work with Ham_Weapon_SecondaryAttack and m_flNextSecondaryAttack instead. Since there's no secondary attack in Deagle, you could just call it manually on Ham_Item_PostFrame as CS itself does.
https://github.com/s1lentq/ReGameDLL...apons.cpp#L903

Also, you should reset the model on Deagle holster and block this function if player is using shield.
__________________









Last edited by CrazY.; 02-19-2019 at 13:58.
CrazY. is offline
thEsp
BANNED
Join Date: Aug 2017
Old 02-19-2019 , 14:09   Re: Realistic Deagle v1.0
Reply With Quote #7

Quote:
Originally Posted by CrazY. View Post
FM_CmdStart

This plugin will perform better if you work with Ham_Weapon_SecondaryAttack and m_flNextSecondaryAttack instead. Since there's no secondary attack in Deagle, you could just call it manually on Ham_Item_PostFrame as CS itself does.
https://github.com/s1lentq/ReGameDLL...apons.cpp#L903

Also, you should reset the model on Deagle holster and block this function if player is using shield.
I've never heard of that before, btw are there any advantages ?
thEsp is offline
thEsp
BANNED
Join Date: Aug 2017
Old 02-26-2019 , 14:32   Re: Realistic Deagle v1.1
Reply With Quote #8

Code:
UPDATE: Version 1.1 (26-02-19) -> Bug fix (Zoom and change weapon)
thEsp is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-26-2019 , 18:30   Re: Realistic Deagle v1.1
Reply With Quote #9

The idea is nice, hope someday someone could make it for all weapons ^^.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 02-27-2019 , 12:12   Re: Realistic Deagle v1.1
Reply With Quote #10

you should add something else, maybe improved accuracy but slower movement
there isn't much point in it otherwise
__________________
<VeCo> 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 19:04.


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