SA-MP Forums Archive
Attached object bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Client Support (https://sampforum.blast.hk/forumdisplay.php?fid=16)
+--- Thread: Attached object bug (/showthread.php?tid=641843)



Attached object bug - Romz - 21.09.2017

Hello! Correct the bug with the attached objects to the player (SetPlayerAttachedObject), they are very interfering when aiming with a sniper rifle, a rocket launcher and a photo camera. I specially recorded the video, it looks very awful and brings a lot of inconvenience.

Video: https://www.youtube.com/watch?v=kjK6GVHwiTc

I hope this bug will be fixed in the future, thanks for your understanding.


Re: Attached object bug - adri1 - 21.09.2017

I think it is a gta issue, not samp


Re: Attached object bug - Romz - 21.09.2017

Quote:
Originally Posted by adri1
Посмотреть сообщение
I think it is a gta issue, not samp
I do not want to advertise anything, but in the adaptation of SAMP to CRMP this bug has been fixed. Maybe there will also be made in 0.3.7 R2?

http://sampsrv.ru/


Re: Attached object bug - adri1 - 21.09.2017

Try this (not tested):

Код:
#define KEY_HANDBRAKE 128 //Right mouse button
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

new Player_Affected_Fix[MAX_PLAYERS];

public OnPlayerDisconnect(playerid, reason)
{
	Player_Affected_Fix[playerid] = false;
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
	{
		if(PRESSED(KEY_HANDBRAKE))
		{
			if(GetPlayerWeapon(playerid) == 34) //sniper
			{
				for(new i = 0; i != MAX_PLAYER_ATTACHED_OBJECTS; i ++) RemovePlayerAttachedObject(playerid, i);
				Player_Affected_Fix[playerid] = true;
			}
		}
		else if(RELEASED(KEY_HANDBRAKE))
		{
			if(Player_Affected_Fix[playerid])
			{
				// Attach player objects
				Player_Affected_Fix[playerid] = false;
			}
		}
	}
	return 1;
}



Re: Attached object bug - Romz - 21.09.2017

Quote:
Originally Posted by adri1
Посмотреть сообщение
Try this (not tested):

Код:
...
This will remove temporarily the object for absolutely all players who are seeing you.
Can you imagine how it looks strange and not beautiful?


Re: Attached object bug - adri1 - 21.09.2017

Yes, I hadn't thought of that


Re: Attached object bug - IstuntmanI - 21.09.2017

Well, I'd like it to be fixed clientsided, but it probably won't be ever fixed. Yeah, most probably another GTA SA engine bug (object's position and rotation when in sniper camera mode is totally wrong, it has nothing to do with SA-MP) that should get a work-around from Kalcor, but, well... we all know that this may never happen, even though this is what I (and probably most of the guys that actually own a SA-MP server that is being actively developed) mostly want from SA-MP (as a proof, look at the history: https://sampwiki.blast.hk/wiki/Bugs - I updated this page because I was mad about all these bugs). SA-MP has enough features and *enough* bugs, bugs should be cut down from now on. (fixes.inc is too damn high !)

Anyway, for a better serversided fix in the future (*cough* YSF *cough*) check this suggestion: https://github.com/Agneese-Saini/SA-MP/issues/5

EDIT: Shouldn't this be posted in Bug Reports ? Everyone knows about this one (and other popular ones) anyway.