23.11.2010, 13:26
How do i make it, that if a player gets hit with a certain weapon (like silenced pistol) it apply's an animation.
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;
}
i tried
pawn Код:
|
Seems like the IsPlayerAimingAtPlayer function doesn't work correctly.
|