User:Stryp

From Multi Theft Auto: Wiki
Revision as of 09:16, 22 April 2011 by Stryp (talk | contribs) (Created page with "== Some useful functions (for me at least) == Deleting colorcodes from whatever (bigbig thanks for '''eeew''') <syntaxhighlight lang="lua">function noColors(input) return input:gsub("#%x%x%x%x%x%...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Some useful functions (for me at least)

Deleting colorcodes from whatever (bigbig thanks for eeew)

function noColors(input) return input:gsub("#%x%x%x%x%x%x","") end

isVehicleLockable by me

function isVehicleLockable (vehicle)
    local lockableVehicles = {594, 606, 607, 611, 584, 608, 435, 450, 591, 539, 441, 464, 501, 465, 564, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 581, 509, 481, 462, 521, 463, 510, 522, 461, 448, 468, 586, 425, 520}
    local itsLockable = false
    local myVehicle = getElementModel(vehicle)
    for k, lockableVehicle in pairs(lockableVehicles) do
        if myVehicle == lockableVehicle then
            itsLockable = true
            return true
        end
    end
    if itsLockable == false then
        return false
    end
end

More will come...