When shot apply an animation?
#1

How do i make it, that if a player gets hit with a certain weapon (like silenced pistol) it apply's an animation.
Reply
#2

getplayerweapon then if player weapon is IdOfSilenced applyanimation....
Reply
#3

Quote:
Originally Posted by dark_clown
Посмотреть сообщение
getplayerweapon then if player weapon is IdOfSilenced applyanimation....
He clearly stated, that if the player GETS shot by a Silenced Pistol, not when he switches to the pistol..
Reply
#4

indeed :P
Reply
#5

Quote:
Originally Posted by DaneAMattie
Посмотреть сообщение
indeed :P
You can use a combination of IsPlayerLookingAt and OnPlayerKeyStateChange.

I actually don't know how, maybe i do, maybe not.
I'm just giving a tip.
Reply
#6

Ermm, IsPlayerAimingAtPlayer (Hmm, there was a function like this, i used something like that before) and check if player pressed FIRE key... This should do, but i'm not sure. I've got a big scripting break
Reply
#7

oke thanks for the reply's i will try something with those functions, if its not working i repost here
Reply
#8

i tried
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
     {
         for(new targetplayerid; targetplayerid<MAX_PLAYERS; targetplayerid++)
         {
             if(IsPlayerAimingAtPlayer(playerid,targetplayerid) && GetPlayerWeapon(playerid) == 23)
             {
                if(PlayerInfo[playerid][Tazer] == 1)
                {
                GameTextForPlayer(targetplayerid,"You have been tazed by a cop!",3000,3);
                ApplyAnimation(targetplayerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
                }
             }
         }
     }
     return 1;
}
but now every player gets tazed :S
Reply
#9

Quote:
Originally Posted by DaneAMattie
Посмотреть сообщение
i tried
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
     {
         for(new targetplayerid; targetplayerid<MAX_PLAYERS; targetplayerid++)
         {
             if(IsPlayerAimingAtPlayer(playerid,targetplayerid) && GetPlayerWeapon(playerid) == 23)
             {
                if(PlayerInfo[playerid][Tazer] == 1)
                {
                GameTextForPlayer(targetplayerid,"You have been tazed by a cop!",3000,3);
                ApplyAnimation(targetplayerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
                }
             }
         }
     }
     return 1;
}
but now every player gets tazed :S
Seems like the IsPlayerAimingAtPlayer function doesn't work correctly.
Reply
#10

Quote:
Originally Posted by TheXIII
Посмотреть сообщение
Seems like the IsPlayerAimingAtPlayer function doesn't work correctly.
indeed, well i used this one: https://sampforum.blast.hk/showthread.php?tid=140765
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)