SA-MP Forums Archive
OnplayerRequestClass gang - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnplayerRequestClass gang (/showthread.php?tid=475153)



OnplayerRequestClass gang - gotwarzone - 11.11.2013

I wonder why each time I click the next/back arrow or "<",">" in onplayerrequestclass this InterpolateCameraPos and InterpolateCameraLookAt always being called. Is there anyway to pause this when choosing skin on the same team?

Let say Mexicans team has 3 skins to choose. When I choose different skin this InterpolateCameraPos and InterpolateCameraLookAt always called.


Код:
		case 0,1,2:
		{
			TextDrawShowForPlayer(playerid, Mexicans1);
			TextDrawHideForPlayer(playerid, Homeless1);
			TextDrawHideForPlayer(playerid, Mafia1);
			TextDrawHideForPlayer(playerid, Yakuza1);
			TextDrawHideForPlayer(playerid, Biker1);
			TextDrawHideForPlayer(playerid, Grove1);
			InterpolateCameraPos(playerid, -2586.111816, 365.485076, 60.749420, -2577.812500, 330.985961, 13.436348, 3000);
			InterpolateCameraLookAt(playerid, -2590.667480, 366.290374, 58.852813, -2573.454833, 329.463684, 11.514471, 3000);
			SetPlayerFacingAngle( playerid, 90);
			SetPlayerPos(playerid, -2571.8079,328.3809,10.5625);
			ApplyAnimation(playerid,"OTB","wtchrace_loop",4.1,1,1,1,0,-1);

		}



Re: OnplayerRequestClass gang - FUNExtreme - 11.11.2013

Yes. Everytime you press the arrow OnPlayerRequestClass is called again. So you either put the camera code somewhere else or you use a variable to know if you have already started the interpolation