getPlayerLevel: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix example)
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
Line 18: Line 18:
|r1= [[Number]] - the provided player's level or -1 on error (unreachable servers, not a player, etc)
|r1= [[Number]] - the provided player's level or -1 on error (unreachable servers, not a player, etc)


|x1= <sqf>player addEventHandler ["Killed", {
|x1= <sqf>
player addEventHandler ["Killed", {
_killer = _this select 1;
_killer = _this select 1;
if (getPlayerLevel _killer < getCurrentPlayerLevel) then
if (getPlayerLevel _killer < getCurrentPlayerLevel) then
Line 25: Line 26:
};
};
}];
}];
</sqf>
</sqf>


|seealso= [[getCurrentPlayerLevel]] [[isPlayerSupporter]]
|seealso= [[getCurrentPlayerLevel]] [[isPlayerSupporter]]
}}
}}

Revision as of 11:34, 3 September 2024

Hover & click on the images for description

Description

Description:
Return the level of the provided player.
Multiplayer:
Only works in multiplayer (on both server and clients).
Groups:
Argo

Syntax

Syntax:
getPlayerLevel unit
Parameters:
unit: Object - a player-controlled unit
Return Value:
Number - the provided player's level or -1 on error (unreachable servers, not a player, etc)

Examples

Example 1:
player addEventHandler ["Killed", { _killer = _this select 1; if (getPlayerLevel _killer < getCurrentPlayerLevel) then { hint "oooooooooh!"; }; }];

Additional Information

See also:
getCurrentPlayerLevel isPlayerSupporter

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note