30.11.2016, 20:35
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:
thanks for your help
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; }