25.05.2011, 16:27 
	
	
	
		Hey, 
I am failing for hours now while trying to increase a variable as long as a player holds down a key.
My current (not working) code:
Any help?
	
	
	
	
I am failing for hours now while trying to increase a variable as long as a player holds down a key.
My current (not working) code:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
                    if(newkeys&4) //CTRL
		    {
				new i=SetTimerEx("LongJumpAngle",50,1,"i",playerid); //TIMER INCREASING THE VARIABLE
				SetPVarInt(playerid,"Minigame2t",i); 
				print("2");
		    }
		    else if(oldkeys&4 && newkeys!=4) //Player releases key...I guess
		    {
		        KillTimer(GetPVarInt(playerid,"Minigame2t"));
		    }
}

