AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] Scout FOV ? (https://forums.alliedmods.net/showthread.php?t=298780)

CrazY. 06-22-2017 12:50

[ H3LP ] Scout FOV ?
 
Hello, I want to change the ROF of scout, it's working fine but if I shoot while zoom is activeted and then change to other weapon, the fov continue. I am using Arkshine code:

Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> const m_pPlayer         = 41; const m_flPrimaryAttack = 46; const m_iFOV            = 363; const m_iClientFOV      = 364; new pCvarRof; public plugin_init () {     register_plugin( "Custom Scout ROF", "1.0.0" , "Arkshine" );     RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_scout", "CScout_PrimaryAttack", 1 );         pCvarRof = register_cvar( "scout_rof", "0.25" ); } public CScout_PrimaryAttack ( const Entity ) {     static Player;     Player = get_pdata_cbase( Entity, m_pPlayer );         set_pdata_int( Player, m_iClientFOV, get_pdata_int( Player, m_iFOV ) );     set_pdata_float( Entity, m_flPrimaryAttack, get_pcvar_float( pCvarRof ), 4 ); }

eyal282 06-22-2017 13:40

Re: [ H3LP ] Scout FOV ?
 
I have literally no idea what you are trying but this might work if you understood your code.
PHP Code:

register_event("CurWeapon""Event_CurWeapon""be""1=1");    

public 
Event_CurWeapon(id)
{
    if(
get_user_weapon(id) != CSW_SCOUT)
    {
         
// Code Here
         
SetUserDab(id1);
    } 



CrazY. 06-22-2017 14:32

Re: [ H3LP ] Scout FOV ?
 
I am trying increase scout rate of fire (ROF), it's working but have a bug with the scope, if I active scope, shoot and then change to another weapon, the scope continue enabled. I want to disable the scope when player change the weapon.

baneado 06-22-2017 15:52

Re: [ H3LP ] Scout FOV ?
 
Restore m_iClientFOV after switch weapon.
You can do it with Ham_Item_Deploy, but you must hook all the weapons

CrazY. 06-22-2017 18:06

Re: [ H3LP ] Scout FOV ?
 
Ok, I will try.

PRoSToTeM@ 06-27-2017 10:02

Re: [ H3LP ] Scout FOV ?
 
Code:
set_pdata_int( Player, m_iClientFOV, get_pdata_int( Player, m_iFOV ) );
->
Code:
const m_bResumeZoom = 440/4; if (bool:get_pdata_int(Player, m_bResumeZoom)) {     set_pdata_int(Player, m_bResumeZoom, false);     const m_iLastZoom = 436/4;     set_pdata_int(Player, m_iFOV, get_pdata_int(Player, m_iLastZoom)); }

CrazY. 06-27-2017 10:34

Re: [ H3LP ] Scout FOV ?
 
Yeah, it's working. Thanks prostotema!


All times are GMT -4. The time now is 22:44.

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