Player aim at a ped
#2

PHP код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_HANDBRAKE)) //The key handbrake = Right mouse button by default (AIM)
    
{
        new 
actorid GetPlayerTargetActor(playerid);
        if(
actorid == SomeActorVar//SomeActorVar is your actorid that you are passing. Like the 24/7 actor or clothes store actor etc..
        
{
            
//Player aimed at the actor do something like animation and robbing stuff
        
}
    }
    return 
1;

Please note that you should create your actor and assign it to a variable first https://sampwiki.blast.hk/wiki/CreateActor
Reply


Messages In This Thread
Player aim at a ped - by Arbico - 17.07.2017, 13:53
Re: Player aim at a ped - by FailerZ - 17.07.2017, 14:08
Re: Player aim at a ped - by Arbico - 17.07.2017, 15:20
Re: Player aim at a ped - by FailerZ - 17.07.2017, 15:53
Re: Player aim at a ped - by Paulice - 17.07.2017, 16:23

Forum Jump:


Users browsing this thread: 1 Guest(s)