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

problem crosshair


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
liubili
Junior Member
Join Date: Apr 2018
Old 09-20-2018 , 16:18   problem crosshair
Reply With Quote #1

Hi, How to fix there was a problem crosshair. crosshair not move how shoot.
check video, https://www.youtube.com/watch?v=umYO...ature=youtu.be

This is the code,
Code:
public UpdateClientData(iPlayer, SendWeapons, CD_Handle)
{
	if(is_user_bot(iPlayer) || !is_user_connected(iPlayer))
		return FMRES_SUPERCEDE;
	
	enum
	{
		SPEC_MODE,
		SPEC_TARGET,
		SPEC_END
	}; 
	
	static aSpecInfo[33][SPEC_END];
	static Float:flGameTime;
	static Float:flLastEventCheck;
	static iTarget;
	static iSpecMode;
	static iActiveItem;
	static id;
	static kGun;
	iTarget = (iSpecMode = pev(iPlayer, pev_iuser1)) ? pev(iPlayer, pev_iuser2) : iPlayer;
	
	iActiveItem = get_pdata_cbase(iTarget, m_pActiveItem, XO_PLAYER);

	if(iActiveItem == NULLENT)
		return FMRES_IGNORED;

	id = get_pdata_int(iActiveItem, m_iId, XO_WEAPON);
	kGun = get_user_weapon(iTarget, _, _);

	flGameTime = get_gametime();
	flLastEventCheck = get_pdata_float(iActiveItem, m_flLastEventCheck, XO_WEAPON);


	if(id)
	{
		if(iSpecMode)
		{
			if(aSpecInfo[iPlayer][SPEC_MODE] != iSpecMode)
			{
				aSpecInfo[iPlayer][SPEC_MODE] = iSpecMode;
				aSpecInfo[iPlayer][SPEC_TARGET] = FALSE;
			}

			if(iSpecMode == OBS_IN_EYE && aSpecInfo[iPlayer][SPEC_TARGET] != iTarget)
			{
				aSpecInfo[iPlayer][SPEC_TARGET] = iTarget;
				
				static iTaskData[2];
				iTaskData[0] = iActive[bUsingGuns[iPlayer][kGun]];	
				iTaskData[1] = WEAPON_IDLE;
				// Because once pushing LMB u will immediately move to OBS_IN_EYE, the anim message may skip, so let's make delay
				set_task(0.1, "SPEC_OBS_IN_EYE", iPlayer, iTaskData, sizeof(iTaskData)); // Delay 0.1, because with high ping this may skip this 99%
			}
		}
		
		if(!flLastEventCheck)
		{	
			set_cd(CD_Handle, CD_flNextAttack, get_gametime() + 0.001);
			set_cd(CD_Handle, CD_WeaponAnim, IDLE_ANIM);
			return FMRES_HANDLED;
		}
		
		if(flLastEventCheck <= flGameTime)
		{				
			SendWeaponAnim(iTarget, GetWeaponDrawAnim(iActiveItem), iActive[bUsingGuns[iTarget][kGun]]); 
			set_pdata_float(iActiveItem, m_flLastEventCheck, 0.0, XO_WEAPON);
		}
	}
	return FMRES_HANDLED;
}

Last edited by liubili; 09-20-2018 at 16:19.
liubili is offline
liubili
Junior Member
Join Date: Apr 2018
Old 10-21-2018 , 12:40   Re: problem crosshair
Reply With Quote #2

up.
liubili is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-22-2018 , 13:05   Re: problem crosshair
Reply With Quote #3

set_cd(CD_Handle, CD_flNextAttack, get_gametime() + 0.001);
You are blocking the original weapon attack code. I don't think there's a way to fix the crosshair.
If it is, I'm not aware of it.
__________________
HamletEagle 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 01:55.


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