OnPlayerKeyStateChange
#1

Код:
if(newkeys == KEY_FIRE)
    {
	   if(sit[playerid] == 1)
	   {
	   sit[playerid] =0;
	   ApplyAnimation(playerid,"FIGHT_C","FightC_M",5,0,0,0,0,0);
	   ClearAnimations(playerid);
	   }
    }
warning
Код:
(12266) : warning 202: number of arguments does not match definition
and if i do this my game crashes
the line 12266 is
Код:
ClearAnimations(playerid);
Reply
#2

You Dont Need Clear Animation Just Change 5 to 0 Use this

Код:
ApplyAnimation(playerid,"FIGHT_C","FightC_M",0,0,0,0,0,0);
Rep Me TnX
Reply
#3

i need to clear animations when i press fire key
Reply
#4

Try this,
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(sit[playerid] == 1)
    {
        ClearAnimations(playerid);
        sit[playerid] = 0;
    }
Reply
#5

Use This :
Код:
if(newkeys == KEY_FIRE)
{
	   if(sit[playerid] == 1)
	   {
	   sit[playerid] =0;
	   ApplyAnimation(playerid,"FIGHT_C","FightC_M",5,0,0,0,0,0);
	   }
if(oldkeys == KEY_FIRE)
{
	   if(sit[playerid] == 0)
	   {
           sit[playerid] =1;
	   ClearAnimations(playerid);
	   }
}
Reply
#6

Still same warning tried both
Reply
#7

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
Still same warning tried both
Are You Use Key Fire For Other ? or Just Use Key_fire For This?
Reply
#8

Код:
if(newkeys & KEY_FIRE)
	{
	    if(sit[playerid])
	    {
	        sit[playerid] = 0;
	        ClearAnimations(playerid);
	    }
	}
There's definitely no way you can get missing arguments unless you're not using an updated version of the includes.
Reply
#9

Use This Its Working
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_FIRE)
{
if(sit[playerid] == 1)
{
sit[playerid] =0;
ApplyAnimation(playerid,"FIGHT_C","FightC_M",5,0,0,0,0,0);
}
}
if(oldkeys == KEY_FIRE)
{
if(sit[playerid] == 0)
{
sit[playerid] =1;
ClearAnimations(playerid);
}
}
return 1;
}
Reply
#10

same warning
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)