26.10.2010, 23:18
(
Последний раз редактировалось Kitten; 24.11.2013 в 05:07.
)
Solved
Ok so i got a code from calgon last night
i never had time to test it but i tested it today it takes your hp away how could i make it to lose the player u hit? uses foreach include pawn Код:
|
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if(PRESSED(KEY_FIRE)) {
if(GetPlayerWeapon(playerid) == 4) {
new
Float: curHealth,
Float: knifeDamagePos[3];
GetPlayerPos(playerid, knifeDamagePos[0], knifeDamagePos[1], knifeDamagePos[2]);
foreach(Player, i) {
if(IsPlayerInRangeOfPoint(i, 1, knifeDamagePos[0], knifeDamagePos[1], knifeDamagePos[2])) {
SetPlayerHealth(i, 0);
return 1;
}
}
}
}
return 1;
}