- Katılım
- 2 yıl 4 ay 27 gün
- Mesajlar
- 23
- Discord
- ! SARI#4891
Merhabalar, Kuzkay_meth'te bir kişi meth yaparkan ikinci kişi meth yapamıyor ben bütün kişiler aynı anda aynı araçta meth yapsın istiyorum ama else kodu ile uyarı veriyor yardımcı olurmusunuz ?
150.satırda dediğim else
150.satırda dediğim else
Kod:
local Keys = {
["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}
local started = false
local displayed = false
local progress = 0
local CurrentVehicle
local pause = false
local selection = 0
local quality = 0
ESX = nil
local LastCar
function DisplayHelpText(str)
SetTextComponentFormat("STRING")
AddTextComponentString(str)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterNetEvent('esx_methcar:stop')
AddEventHandler('esx_methcar:stop', function()
started = false
DisplayHelpText("~r~Production stopped...")
FreezeEntityPosition(LastCar, false)
end)
RegisterNetEvent('esx_methcar:stopfreeze')
AddEventHandler('esx_methcar:stopfreeze', function(id)
FreezeEntityPosition(id, false)
end)
RegisterNetEvent('esx_methcar:notify')
AddEventHandler('esx_methcar:notify', function(message)
ESX.ShowNotification(message)
end)
RegisterNetEvent('esx_methcar:startprod')
AddEventHandler('esx_methcar:startprod', function()
DisplayHelpText("~g~Starting production")
started = true
FreezeEntityPosition(CurrentVehicle,true)
displayed = false
print('Started Meth production')
ESX.ShowNotification("~r~Meth production has started")
SetPedIntoVehicle(GetPlayerPed(-1), CurrentVehicle, 3)
SetVehicleDoorOpen(CurrentVehicle, 2)
end)
RegisterNetEvent('esx_methcar:blowup')
AddEventHandler('esx_methcar:blowup', function(posx, posy, posz)
AddExplosion(posx, posy, posz + 2,23, 20.0, true, false, 1.0, true)
if not HasNamedPtfxAssetLoaded("core") then
RequestNamedPtfxAsset("core")
while not HasNamedPtfxAssetLoaded("core") do
Citizen.Wait(1)
end
end
SetPtfxAssetNextCall("core")
local fire = StartParticleFxLoopedAtCoord("ent_ray_heli_aprtmnt_l_fire", posx, posy, posz-0.8 , 0.0, 0.0, 0.0, 0.8, false, false, false, false)
Citizen.Wait(6000)
StopParticleFxLooped(fire, 0)
end)
RegisterNetEvent('esx_methcar:smoke')
AddEventHandler('esx_methcar:smoke', function(posx, posy, posz, bool)
if bool == 'a' then
if not HasNamedPtfxAssetLoaded("core") then
RequestNamedPtfxAsset("core")
while not HasNamedPtfxAssetLoaded("core") do
Citizen.Wait(1)
end
end
SetPtfxAssetNextCall("core")
local smoke = StartParticleFxLoopedAtCoord("exp_grd_flare", posx, posy, posz + 1.7, 0.0, 0.0, 0.0, 2.0, false, false, false, false)
SetParticleFxLoopedAlpha(smoke, 0.8)
SetParticleFxLoopedColour(smoke, 0.0, 0.0, 0.0, 0)
Citizen.Wait(22000)
StopParticleFxLooped(smoke, 0)
else
StopParticleFxLooped(smoke, 0)
end
end)
RegisterNetEvent('esx_methcar:drugged')
AddEventHandler('esx_methcar:drugged', function()
SetTimecycleModifier("drug_drive_blend01")
SetPedMotionBlur(GetPlayerPed(-1), true)
SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
SetPedIsDrunk(GetPlayerPed(-1), true)
Citizen.Wait(300000)
ClearTimecycleModifier()
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
playerPed = GetPlayerPed(-1)
local pos = GetEntityCoords(GetPlayerPed(-1))
if IsPedInAnyVehicle(playerPed) then
CurrentVehicle = GetVehiclePedIsUsing(PlayerPedId())
car = GetVehiclePedIsIn(playerPed, false)
LastCar = GetVehiclePedIsUsing(playerPed)
local model = GetEntityModel(CurrentVehicle)
local modelName = GetDisplayNameFromVehicleModel(model)
if modelName == 'JOURNEY' and car then
if GetPedInVehicleSeat(car, -1) == playerPed then
if started == false then
if displayed == false then
DisplayHelpText("Press ~INPUT_THROW_GRENADE~ to start making drugs")
displayed = true
end
end
if IsControlJustReleased(0, Keys['G']) then
if pos.y >= 3500 then
if IsVehicleSeatFree(CurrentVehicle, 3) then
TriggerServerEvent('esx_methcar:start')
progress = 0
pause = false
selection = 0
quality = 0
else
DisplayHelpText('~r~The car is already occupied')
end
else
ESX.ShowNotification('~r~You are too close to the city, head further up north to begin meth production')
end
end
end
end
else
if started then
started = false
displayed = false
TriggerEvent('esx_methcar:stop')
print('Stopped making drugs')
FreezeEntityPosition(LastCar,false)
end
end
if started == true then
if progress < 96 then
Citizen.Wait(6000)
if not pause and IsPedInAnyVehicle(playerPed) then
progress = progress + 1
ESX.ShowNotification('~r~Meth production: ~g~~h~' .. progress .. '%')
Citizen.Wait(6000)
end
if IsPedInAnyVehicle(playerPed) then
TriggerServerEvent('esx_methcar:make', pos.x,pos.y,pos.z)
if pause == false then
selection = 0
quality = quality + 1
progress = progress + math.random(1, 2)
ESX.ShowNotification('~r~Meth production: ~g~~h~' .. progress .. '%')
end
else
TriggerEvent('esx_methcar:stop')
end
else
TriggerEvent('esx_methcar:stop')
progress = 100
ESX.ShowNotification('~r~Meth production: ~g~~h~' .. progress .. '%')
ESX.ShowNotification('~g~~h~Production finished')
TriggerServerEvent('esx_methcar:finish', quality)
FreezeEntityPosition(LastCar, false)
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
if IsPedInAnyVehicle(GetPlayerPed(-1)) then
else
if started then
started = false
displayed = false
TriggerEvent('esx_methcar:stop')
print('Stopped making drugs')
FreezeEntityPosition(LastCar,false)
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if pause == true then
if IsControlJustReleased(0, Keys['1']) then
selection = 1
ESX.ShowNotification('~g~Selected option number 1')
end
if IsControlJustReleased(0, Keys['2']) then
selection = 2
ESX.ShowNotification('~g~Selected option number 2')
end
if IsControlJustReleased(0, Keys['3']) then
selection = 3
ESX.ShowNotification('~g~Selected option number 3')
end
end
end
end)