ApplyAnim after player landing
#1

i have a problem with my code..

i would like the player do a animation after jumping and landing..

My Code work for the first time, but if i jump again or again, it bugs a little

Code:
Код:
new bhopAnim[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
	bhopAnim[playerid] = 0;
	return 1;
}
public OnPlayerUpdate(playerid)
{
     if(bhopAnim[playerid] == 1)
     {
          if(GetPlayerAnimationIndex(playerid))
          {
               new animlib[32], animname[32];
               GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
               if(!strcmp(animname, "JUMP_LAND", true))
               {
     				ApplyAnimation(playerid, "PED","FALL_LAND", 4.1, 0,1,1,0,0);
                    SendClientMessage(playerid, 0xFFFFFFFF, "MakeAnimation");
                    SendClientMessage(playerid, 0xFFFFFFFF, "");
                    bhopAnim[playerid] = 0;
               }
          }
     }
     return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if((newkeys & KEY_JUMP) && !IsPlayerInAnyVehicle(playerid))
     {
          SendClientMessage(playerid, 0xFFFFFFFF, "if JUMP && !Car");
          SendClientMessage(playerid, 0xFFFFFFFF, "");
          if((oldkeys & KEY_UP) || (oldkeys & KEY_DOWN) || (oldkeys & KEY_LEFT) || (oldkeys & KEY_RIGHT) || (oldkeys & KEY_SPRINT))
          {
               SendClientMessage(playerid, 0xFFFFFFFF, "if (W || A || S || D || SHIFT)");
               SendClientMessage(playerid, 0xFFFFFFFF, "");
               bhopAnim[playerid] = 1;
          }
     }
     return 1;
}
thanks for your help
Reply


Messages In This Thread
ApplyAnim after player landing - by shaun_baker - 30.11.2016, 20:35
Re: ApplyAnim after player landing - by TheRohlikar - 30.11.2016, 22:08
Re: ApplyAnim after player landing - by shaun_baker - 30.11.2016, 22:18
Re: ApplyAnim after player landing - by TheRohlikar - 30.11.2016, 22:24
Re: ApplyAnim after player landing - by shaun_baker - 30.11.2016, 22:29
Re: ApplyAnim after player landing - by TheRohlikar - 30.11.2016, 22:33

Forum Jump:


Users browsing this thread: 1 Guest(s)