0 Üye ve 1 Ziyaretçi konuyu incelemekte.
local acikmi = falsefunction ghostmode_on() local playerVehicle = getPedOccupiedVehicle(localPlayer) if(playerVehicle) then -- Check the return value.if acikmi == false then for i,v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, false) endacikmi = trueoutputChatBox("Koruma Aktif Edildi")else for i,v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, true) endacikmi = false endendaddCommandHandler("ghost", ghostmode_on)
local acikmi = 2function ghostmode_on() local playerVehicle = getPedOccupiedVehicle(localPlayer) if(playerVehicle) then -- Check the return value.if acikmi == 2 then for i,v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, false) endacikmi = 1outputChatBox("Koruma Aktif Edildi")else for i,v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, true) endacikmi = 2outputChatBox("Koruma DeAktif Edildi") endendaddCommandHandler("ghost", ghostmode_on)
local acikmi = 2function ghostmode_on() local playerVehicle = getPedOccupiedVehicle(localPlayer) if(playerVehicle) then -- Check the return value.if acikmi == 2 then for i,v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, false) endacikmi = 1outputChatBox("Koruma Aktif Edildi")else for i,v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, true) endacikmi = 2outputChatBox("Koruma DeAktif Edildi")end endendaddCommandHandler("ghost", ghostmode_on)
local state = falseaddCommandHandler("ghost", function() local playerVehicle = getPedOccupiedVehicle(localPlayer) if playerVehicle then for _, v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, state) end state = not state outputChatBox(state and "Koruma Aktif Edildi" or "Koruma Deaktif Edildi") endend)
Zaten çözülmüş ama kodu bu şekilde kullanmanı tavsiye ederim:Kodlocal state = falseaddCommandHandler("ghost", function() local playerVehicle = getPedOccupiedVehicle(localPlayer) if playerVehicle then for _, v in pairs(getElementsByType("vehicle")) do setElementCollidableWith(v, playerVehicle, state) end state = not state outputChatBox(state and "Koruma Aktif Edildi" or "Koruma Deaktif Edildi") endend)Kodu ne kadar az tekrar yaparak yazarsak o kadar iyi. Bunu erken alışkanlık edinirsen ilerde çok işine yarar.