Hallo
Ich hab mier einen AFK Script gebasstelt es sind leider noch paar bugs drinne kann mir denn einer helfen.Man wird immer gekillt wenn man back macht
Server
Code
addEvent("onAFK", true )function afk ()killPed ( source )endaddEventHandler("onAFK", getRootElement(), afk )
Client
Code
local afk = 0
function setafk()if(afk ~= 0) thenoutputChatBox("Du bist schon AFK!")elseafk = 1outputChatBox("Du bist jetzt AFK.")triggerServerEvent("onAFK", getLocalPlayer() )outputChatBox("Du wurdest vom Anti-AFK System " )endend
function setback()if(afk ~= 1) thenoutputChatBox("Du bist nicht AFK")elseafk = 0outputChatBox("Du bist nun nicht mehr afk")endend
addCommandHandler("afk", setafk)addCommandHandler("back", setback)
function onMapStart ()if ( afk == 1 ) thentriggerServerEvent("onAFK", getLocalPlayer() )outputChatBox("Du wurdest vom Anti-AFK System " )setTimer( function()triggerServerEvent("onAFK", getLocalPlayer() )end, 10000, 1 )endendaddEvent("onClientMapStarting", true )addEventHandler("onClientMapStarting", getRootElement(), onMapStart )