03.09.2013, 01:20
How can i do that if a player attacks another player or shoots on the sky then it will give him 1 wanted level
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(GetPlayerWantedLevel(playerid) < 1)
{
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
}
}
}
return 1;
}
pawn Код:
|
You are correct, however players do not need to aim to fire a weapon. Although it would be useful to add a GetPlayerWeapon line in the code to make sure a player is indeed holding a weapon. Thank you for clearing that for me TonyII.
|