02.08.2010, 18:23
(
Последний раз редактировалось [XST]O_x; 02.08.2010 в 19:05.
)
Hey,so I need help with this.
Well, I saw this function called IsPlayerAmingAt and IsPlayerAmingAtPlayer by niCe.
And I may didn't get how to use it right,but this is what I tried to do:
It should set the aimed player's health to zero if the shooter is using a Country Rifle(weapon ID 33)
All the functions and stocks can be found here
Never mind,solved thanks to Hiddos,solution: run a loop through all aimed players.
Well, I saw this function called IsPlayerAmingAt and IsPlayerAmingAtPlayer by niCe.
And I may didn't get how to use it right,but this is what I tried to do:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
{
new targetplayerid;
if(IsPlayerAimingAtPlayer(playerid,targetplayerid) && GetPlayerWeapon(playerid) == 33)
{
SetPlayerHealth(targetplayerid,0.0);
}
}
return 1;
}
It should set the aimed player's health to zero if the shooter is using a Country Rifle(weapon ID 33)
All the functions and stocks can be found here
Never mind,solved thanks to Hiddos,solution: run a loop through all aimed players.