24.02.2018, 13:14
PHP код:
new Kidnapper[MAX_PLAYERS], hitman[MAX_PLAYERS];//add classes like that
PHP код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
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;
}
By the way, if you're curious about the keys and want to know how to get them feel free to check this wiki post:
https://sampwiki.blast.hk/wiki/Keys