Category: Player
Since engine version: 1.0 OC
Hostile
Description
Determines whether two players are enemies. Two players will be opposed if at least one of them has declared hostility towards the other.
Syntax
bool Hostile(int player1, int player2, bool check_one_way);
Parameters
- player1:
- First player
- player2:
- Second player
- check_one_way:
- [opt] If
true
, checks only if player1 is hostile towards player2 but not in reverse.
Example
protected func RejectEntrance(object other) { return !Hostile(GetOwner(), GetOwner(other)); }
The object can only be collected by friendly players.
See also: SetHostility