0 Üye ve 1 Ziyaretçi konuyu incelemekte.
local playerTeam = getPlayerTeam(source)local takimi = "takım1"İf playerTeam thenİf playerTeam == takimi then return endEndCalisacak kod buraya
local state = trueaddCommandHandler("takim1", function() if state then --fonksiyonlar endend)addCommandHandler("kontrol", function() if state then state = false outputChatBox("/takim1 komutu pasif") else state = true outputChatBox("/takim1 komutu aktif") endend)
state kontrol ile yapabilirsin.Kodlocal state = trueaddCommandHandler("takim1", function() if state then --fonksiyonlar endend)addCommandHandler("kontrol", function() if state then state = false outputChatBox("/takim1 komutu pasif") else state = true outputChatBox("/takim1 komutu aktif") endend)Bu komutun çalışıp çalışmayacağını state belirler. false yaparsan çalışmaz.
local state = truefunction teamone (player) outputChatBox("Başarıyla Birinci Takıma Geçiş Yaptın",player,0,255,0,true) setPlayerSkin(player,287) giveWeapon(player,31,1000) setElementPosition(player,-1367, -29, 14)endaddCommandHandler("takim1",teamone)function teamtwo (player) outputChatBox("Başarıyla İkinci Takıma Geçiş Yaptın",player,0,255,0,true) setPlayerSkin(player,285) giveWeapon(player,31,1000) setElementPosition(player,-1367, -29, 14) endaddCommandHandler("takim2",teamtwo) addCommandHandler("takim1", function() if state then teamone endend)addCommandHandler("kontrol", function() if state then state = false outputChatBox("/takim1 komutu pasif") else state = true outputChatBox("/takim1 komutu aktif") endend)
local bool = true -- Komutun kullanıma müsait olup olmadığını kontrol edeceğin yer.function changeTeam(...) if not (bool) then return false end -- Eğer bool 'false' ise return yapacağı için fonksiyon burada durur.endfunction cbool() -- Bu fonksiyon bool değişkenini değil yapar yani true ise false, false ise true'e çevirir. bool = not bool;end