Wierd bug
#1

I've been fixing our animations lately and did this.

Код:
txtAnimHelper = TextDrawCreate(610.0, 400.0,
	"~r~~k~~PED_SPRINT~ ~w~to stop the animation");
	TextDrawUseBox(txtAnimHelper, 0);
	TextDrawFont(txtAnimHelper, 2);
	TextDrawSetShadow(txtAnimHelper,0);
    TextDrawSetOutline(txtAnimHelper,1);
    TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
    TextDrawColor(txtAnimHelper,0xFFFFFFFF);
    TextDrawAlignment(txtAnimHelper,3);
^ This is "OnGameModeInit"

Код:
if(PRESSED(KEY_SPRINT))
{
	if(IsPlayerApplyingAnimation[playerid])
	{
		ClearAnimations(playerid);
		TextDrawHideForPlayer(playerid, txtAnimHelper);
		IsPlayerApplyingAnimation[playerid] = 0;
	}
}
and this here is "onPlayerKeyStateChange".


It shows a message for a player once he did an animation so I've obviously put
Код:
TextDrawShowForPlayer(playerid, txtAnimHelper); IsPlayerApplyingAnimation[playerid] = 1;}
under each Animation command.



Now to the problem. Whenever a player enters a car he gets shown "Press space to stop the animation".
No idea where this comes from. Any idea? oO

(just tested it with bikes, message also pops up)
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange read the wiki page, it tells you how to check for a key being pressed properly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)