04.02.2010, 13:44
[b]Is it possible to detect with what weapons is player shot?
If yes, how?
WeA
If yes, how?
WeA
OnPlayerDeath(playerid,killerid,reason)
{
if(reason == 31) // M4
return 31;
return 1;
}
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
}
}