MTASA TÜRK
Türkiye'nin En Güncel MTA Platformu


[YARDIM] AFK Sistem

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 146
  • Batmaz Gaming
: 23 Nisan 2017, 11:58:43
Merhaba arkadaşlar community'de bir AFK Sistemi buldum bu sistemde /afk yazdıktan sonra adamın freeze (donma) yemesini istiyorum yani /afk yazdıktan 15 saniye sonra adam donuk bir şekilde haraket edemesin bunu ayarlayabilecek biri varsa şimdiden teşekkürler

Kod: lua
Tommy_COMMAND = { }
Tommy_TIME = 300000
function toggleAfkMode(thePlayer, playerSource)
if getElementData(thePlayer,"AfkOFF") then
outputChatBox ( "☐ Uyari: 15 Saniye Bekleyin...", thePlayer, 244,189,56 )
end

if getElementData(thePlayer,"AfkON") then
outputChatBox ( "☐ Uyari: AFK Sistem Devre Disi Birakiliyor...", thePlayer, 244,189,56 )
end

setTimer(function()
if getElementData(thePlayer,"AfkMode") then

setElementData(thePlayer,"AfkMode",false)
setElementData(thePlayer,"AfkOFF",true)
setElementData(thePlayer,"AfkON",false)

setElementAlpha(thePlayer, 255)
toggleControl (thePlayer, "fire", true)
toggleControl (thePlayer, "next_weapon", true)
toggleControl (thePlayer, "previous_weapon", true)
toggleControl (thePlayer, "aim_weapon", true)

outputChatBox ( "☑ Basarili: AFK Devre Disi.", thePlayer, 56,244,69 )


else
if (Tommy_COMMAND[playerSource]) then
return outputChatBox ( "☒ Hata: Son kullanimdan sonra 5 dakika bekleyin", thePlayer, 244,56,56 )

end

setElementData(thePlayer,"AfkMode",true)
setElementData(thePlayer,"AfkOFF",false)
setElementData(thePlayer,"AfkON",true)
setElementAlpha(thePlayer, 127)

toggleControl (thePlayer, "fire", false)
toggleControl (thePlayer, "next_weapon", false)
toggleControl (thePlayer, "previous_weapon", false)
toggleControl (thePlayer, "aim_weapon", false)

outputChatBox ( "☑ Basarili: AFK Sistem Aktif.", thePlayer, 56,244,69 )

Tommy_COMMAND[playerSource] = true
setTimer( function()
Tommy_COMMAND[playerSource] = false
end, Tommy_TIME, 1)
end
end, 15000, 1)
end
addCommandHandler("afk",toggleAfkMode)

function login_AFKOFF (thePlayer)
setElementData(thePlayer,"AfkOFF",true)
end
addEventHandler("onPlayerLogin",root, login_AFKOFF)

function logout_AFKOFF (thePlayer)
setElementData(thePlayer,"AfkOFF",true)
end
addEventHandler("onPlayerLogout",root, logout_AFKOFF)

function join_AFKOFF (thePlayer)
setElementData(thePlayer,"AfkOFF",true)
end
addEventHandler("onPlayerJoin",root, join_AFKOFF)
 


MTASA TÜRK

[YARDIM] AFK Sistem
« : 23 Nisan 2017, 11:58:43 »

Çevrimdışı Rüzgar

  • Acemi Üye
  • *
    • İleti: 158
Yanıtla #1 : 23 Nisan 2017, 12:30:05
Kod: lua
Tommy_COMMAND = { }
Tommy_TIME = 300000
oyuncuDondur = setFrozen;
function toggleAfkMode(thePlayer, playerSource)
                        if getElementData(thePlayer,"AfkOFF") then
                                outputChatBox ( "☐ Uyari: 15 Saniye Bekleyin...", thePlayer, 244,189,56 )
                        end
                       
                        if getElementData(thePlayer,"AfkON") then
                                outputChatBox ( "☐ Uyari: AFK Sistem Devre Disi Birakiliyor...", thePlayer, 244,189,56 )
                        end
               
        setTimer(function()             
                if getElementData(thePlayer,"AfkMode") then
 
                        setElementData(thePlayer,"AfkMode",false)
                        setElementData(thePlayer,"AfkOFF",true)
                        setElementData(thePlayer,"AfkON",false)
                               
                        setElementAlpha(thePlayer, 255)
                        toggleControl (thePlayer, "fire", true)
                        toggleControl (thePlayer, "next_weapon", true)
                        toggleControl (thePlayer, "previous_weapon", true)
                        toggleControl (thePlayer, "aim_weapon", true)
                        thePlayer:oyuncuDondur(false)
                        outputChatBox ( "☑ Basarili: AFK Devre Disi.", thePlayer, 56,244,69 )
                               
               
                else
                        if (Tommy_COMMAND[playerSource]) then
                                return outputChatBox ( "☒ Hata: Son kullanimdan sonra 5 dakika bekleyin", thePlayer, 244,56,56 )
 
                        end
                               
                        setElementData(thePlayer,"AfkMode",true)
                        setElementData(thePlayer,"AfkOFF",false)
                        setElementData(thePlayer,"AfkON",true)
                        setElementAlpha(thePlayer, 127)
                               
                        toggleControl (thePlayer, "fire", false)
                        toggleControl (thePlayer, "next_weapon", false)
                        toggleControl (thePlayer, "previous_weapon", false)
                        toggleControl (thePlayer, "aim_weapon", false)
                        thePlayer:oyuncuDondur(true)
 
                        outputChatBox ( "☑ Basarili: AFK Sistem Aktif.", thePlayer, 56,244,69 )
                       
                        Tommy_COMMAND[playerSource] = true
                        setTimer( function()
                                Tommy_COMMAND[playerSource] = false
                        end, Tommy_TIME, 1)
                end
        end, 15000, 1)
end
addCommandHandler("afk",toggleAfkMode)
 
function login_AFKOFF (thePlayer)
        setElementData(thePlayer,"AfkOFF",true)
end
addEventHandler("onPlayerLogin",root, login_AFKOFF)
 
function logout_AFKOFF (thePlayer)
        setElementData(thePlayer,"AfkOFF",true)
end
addEventHandler("onPlayerLogout",root, logout_AFKOFF)
 
function join_AFKOFF (thePlayer)
        setElementData(thePlayer,"AfkOFF",true)
end
addEventHandler("onPlayerJoin",root, join_AFKOFF)

Kod: xml
<oop>true</oop>
« Son Düzenleme: 23 Nisan 2017, 12:31:46 Gönderen: Rüzgar »