HU/Boolean

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

A boolean vagy bool egy adattípus, melynek értéke lehet igaz vagy hamis. Ezeket gyakran a funkciók jelzésére adják vissza, hogy a művelet sikeres volt-e, vagy sem.

A tostring() és type() függvények segíthetnek kideríteni, hogy valami milyen típusú adattípus:

local theReturn = isPedDead(getRandomPlayer())
outputChatBox("The return was: "..tostring(theReturn)) -- Kiírja, hogy: "igaz" vagy "hamis"
outputChatBox("The datatype of this return was: "..type(theReturn)) -- "boolean"-t fog kiírni


Reversing bools

bool = true
-- ha meg akarja fordítani a két értéket, megteheti
bool = false
-- vagy
bool = not bool

Fordította

Surge