Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define armL 0
- #define armR 1
- #define legL 2
- #define legR 3
- #define stomach 4
- #define gravity 5
- stock IsPlayerInWater(playerid)
- {
- new animlib[32],tmp[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,tmp,32);
- if( !strcmp(animlib, "SWIM") && !IsPlayerInAnyVehicle(playerid) ) return true;
- return false;
- }
- stock IsPlayerDucked(playerid)
- {
- if(GetPlayerSpecialAction(playerid)==SPECIAL_ACTION_DUCK) return true;
- return false;
- }
- stock IsPlayerAim(playerid)
- {
- new animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid),animname,32,animname,32);
- if( strfind(animname,"GUN_STAND",true) != -1 ) return true;
- else if( strfind(animname,"COLT45_FIRE",true) != -1 ) return true;
- return false;
- }
- stock IsPlayerStand(playerid)
- {
- new animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid),animname,32,animname,32);
- if( strfind(animname,"IDLE_STANCE",true) != -1 ) return true;
- return false;
- }
- stock IsPlayerDuckedMove(playerid)
- {
- new animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid),animname,32,animname,32);
- if( strfind(animname,"GUNCROUCHFWD",true) != -1 ) return true;
- return false;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerAnimationIndex(playerid))
- {
- new animname[32],animlib[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
- new bodypart=-1;
- if(strfind(animname,"DAM_armL",true)!=-1) bodypart=armL;
- else if(strfind(animname,"DAM_armR",true)!=-1) bodypart=armR;
- else if(strfind(animname,"DAM_LegL",true)!=-1) bodypart=legL;
- else if(strfind(animname,"DAM_LegR",true)!=-1) bodypart=legR;
- else if(strfind(animname,"DAM_stomach",true)!=-1) bodypart=stomach;
- else if(strfind(animlib,"DAM_JUMP",true)!=-1) bodypart=gravity;
- if(bodypart!=-1) OnPlayerDamaged(playerid, bodypart);
- }
- return 1;
- }
- forward OnPlayerDamaged(playerid, bodypart);
- public OnPlayerDamaged(playerid, bodypart)
- {
- if(bodypart == armL) print("OH MY ARM");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement