20.07.2015, 05:03
Quote:
Did you read my post above? I don't want to check if the player is shooting or whatever, I just want to check if the player is aiming and then if he has less than 30 HP there will be a Drunk Effect.
|
pawn Код:
// [ DEVELOPMENT GAMEMODE ]
// INCLUDES:
#include <a_samp>
// DEFINES:
// GENERAL:
#define KEY_AIM KEY_HANDBRAKE
// KEY PRESS TYPES:
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
// MAIN:
main()
{
print("Development Mode: player_aiming.amx");
}
// CALLBACKS:
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(HOLDING(KEY_AIM))
{
SendClientMessage(playerid, -1, "You are now aiming.");
}
else if(RELEASED(KEY_AIM))
{
SendClientMessage(playerid, -1, "You are no longer aiming.");
}
return 1;
}
![](http://i.imgur.com/S6usdMg.png)