29.10.2011, 08:55
Hey,
SA-MP team just released the new update of 0.3d which contains GetPlayerTargetPlayer function.
This function allows us to detect aiming of players on other players.
With this, I created a new callback called OnPlayerTargetPlayer that called everytime that the target of player is changed.
Script:
http://pastebin.com/EeHumBCP
To install it, just put the script on pawno/include and add the next lines:
- OnPlayerUpdate
- OnPlayerConnect
- Somewhere on your script
Note: The callback is called everytime that GetPlayerTargetPlayer value changed, what means that it will called if the player is aiming someone or if he stopped aiming.
Enjoy
SA-MP team just released the new update of 0.3d which contains GetPlayerTargetPlayer function.
This function allows us to detect aiming of players on other players.
With this, I created a new callback called OnPlayerTargetPlayer that called everytime that the target of player is changed.
Script:
http://pastebin.com/EeHumBCP
To install it, just put the script on pawno/include and add the next lines:
pawn Код:
OPTP_OnPlayerUpdate(playerid);
pawn Код:
OPTP_OnPlayerConnect(playerid);
pawn Код:
OnPlayerTargetPlayer(playerid,newtarget,oldtarget)
{
return 1;
}
Note: The callback is called everytime that GetPlayerTargetPlayer value changed, what means that it will called if the player is aiming someone or if he stopped aiming.
Enjoy
![Wink](images/smilies/wink.png)