04.02.2010, 14:46
You can't detect when a player gets shot, (well not easily or accurately) there are some functions out there.
You can make a system to detect when a player fires a weapon(again not accurately);
The problem is people can tap their fire button, not actually firing any bullets.
You can make a system to detect when a player fires a weapon(again not accurately);
The problem is people can tap their fire button, not actually firing any bullets.
pawn Код:
public OnPlayerUpdate(playerid)
{
new keys, ud, lr, wpnid = GetPlayerWeapon(playerid);
GetPlayerKeys(playerid, keys, ud, lr);
//player on foot, pressing fire, holding a "firing" weapon
if( GetPlayerState == PLAYER_STATE_ONFOOT && keys & KEY_FIRE && wpnid > 22 && wpnid < 38)
{
//player has fired weapon or is about to
}
}