Ajoneuvon asedropit pois By "Not Static"

Masi

Ylläpito
Ylläpitäjä
Moderator
Vanhempi jäsen
Wiki
13 Huhtikuu 2019
938
173
43
Lua:
local a = {
    0x1B06D571, -- Pistol
    0x1D073A89, -- ShotGun
    0x83BF0278, -- Carbine
    0x5FC3C11, -- Sniper
}
local b = false
local c = {}
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if(IsPedInAnyPoliceVehicle(GetPlayerPed(-1))) then
            if(not b) then
                b = true
            end
        else
            if(b) then
                for i,k in pairs(a) do
                    if(not c[i]) then
                        RemoveWeaponFromPed(GetPlayerPed(-1), k)
                    end
                end
                b = false
            end
        end
    end
end)
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if(not IsPedInAnyVehicle(GetPlayerPed(-1))) then
            for i=1,#a do
                if(HasPedGotWeapon(GetPlayerPed(-1), a[i], false)==1) then
                    c[i] = true
                else
                    c[i] = false
                end
            end
        end
        Citizen.Wait(5000)
    end
end)