ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. bitTest

Function

bitTest

Server and clientBitwise operationsIdentical to MTA:SA

Checks whether the bitwise AND of all arguments is non-zero, i.e. whether they share a set bit.

Syntax

bool bitTest(int value, int ...)

Arguments

valueint
The number.
...int
More numbers (masks).

Returns

true if the result is not zero.

Example

local FLAG_ADMIN = 2
local flags = 3
if bitTest(flags, FLAG_ADMIN) then
    outputServerLog("Ma flagę admina")
end