SA-MP Forums Archive
Actor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Actor (/showthread.php?tid=633718)



Actor - MrAhmed - 06.05.2017

Hello, is there any function like this >> OnPlayerAimOnActor?
so when a players aims on an actor i can let the actor make animation handsup and much more things.

Thanks in advance


Re: Actor - ShihabSoft - 06.05.2017

You could use GetPlayerTargetPlayer to get the being aimed at, player id

https://sampwiki.blast.hk/wiki/GetPlayerTargetPlayer

then just use it on OnPlayerUpdate to check if he's aiming or not and do some action


Re: Actor - MrAhmed - 06.05.2017

Thank you that helped me


Re: Actor - ShihabSoft - 06.05.2017

Always


Re: Actor - MrAhmed - 06.05.2017

I tried this

PHP код:

public OnPlayerUpdate(playerid)
{
    if(
GetPlayerTargetActor(playerid) == 179)
    {
        
SendClientMessage(playeridCOLOR_WHITE"Works");
    }

But when i aim on any actor that is id 179 nothing happens
Can anyone help me please?


Re: Actor - MrAhmed - 06.05.2017

Never mind fixed.