Jump to content

afk with godmode


Minotaur

Recommended Posts

function afkstart ( player )

local name = getPlayerName ( player )

local x,y,z = getElementPosition ( player )

if isElementFrozen ( player ) then

setElementFrozen ( player, false )

destroyElement ( znak )

outputChatBox ( "#ffffffGracz #ff0000"..name.."#ffffff wraca do gry, można w niego strzelać !", getRootElement(), 255, 0, 0, true )

else

setElementFrozen ( player, true )

znak = createMarker ( x, y, z+2, "checkpoint", 1.5, 0, 255, 0 )

outputChatBox ( "#ffffffGracz #ff0000"..name.."#ffffff przechodzi w tryb AFK, nie strzelac do niego !", getRootElement(), 255, 0, 0, true )

end

end

addCommandHandler ( "afk", afkstart )

i want to if the players is afk set him to godmode anyone can help me?

Link to comment

local playerHealth = getElementHealth ( getLocalPlayer() )

if playerHealth = -<99 then

setElementHealth ( getLocalPlayer(), 100)

end

function afkstart ( player )

local name = getPlayerName ( player )

local x,y,z = getElementPosition ( player )

if isElementFrozen ( player ) then

setElementFrozen ( player, false )

destroyElement ( znak )

outputChatBox ( "#ffffffGracz #ff0000"..name.."#ffffff wraca do gry, można w niego strzelać !", getRootElement(), 255, 0, 0, true )

else

setElementFrozen ( player, true )

znak = createMarker ( x, y, z+2, "checkpoint", 1.5, 0, 255, 0 )

outputChatBox ( "#ffffffGracz #ff0000"..name.."#ffffff przechodzi w tryb AFK, nie strzelac do niego !", getRootElement(), 255, 0, 0, true )

end

end

addCommandHandler ( "afk", afkstart )

not good. script error: afksystem/afk.lua:2: 'then' expected near '='

Link to comment
  
local playerHealth = getElementHealth ( getLocalPlayer() ) 
if playerHealth == <99 then 
setElementHealth ( getLocalPlayer(), 100) 
end 
function afkstart ( player ) 
local name = getPlayerName ( player ) 
local x,y,z = getElementPosition ( player ) 
if isElementFrozen ( player ) then  
setElementFrozen ( player, false ) 
destroyElement ( znak ) 
outputChatBox ( "#ffffffGracz #ff0000"..name.."#ffffff wraca do gry, można w niego strzelać !", getRootElement(), 255, 0, 0, true ) 
else 
setElementFrozen ( player, true ) 
znak = createMarker ( x, y, z+2, "checkpoint", 1.5, 0, 255, 0 ) 
outputChatBox ( "#ffffffGracz #ff0000"..name.."#ffffff przechodzi w tryb AFK, nie strzelac do niego !", getRootElement(), 255, 0, 0, true ) 
end 
end 
addCommandHandler ( "afk", afkstart ) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...