Jump to content

Anti Logout


lubiekeppa

Recommended Posts

The problem is that I do not understand what a colleague wrote above. I have a script but it seems to me that it is not complete.The script in Polish

  
antyRelogWindow = guiCreateWindow( 0.35, 0.03, 0.30, 0.10, "Powiadomienie", true ) 
guiWindowSetMovable(antyRelogWindow, false) 
guiWindowSetSizable(antyRelogWindow, false) 
  
text1AR = guiCreateLabel(0.08, 0.29, 0.87, 0.17, "UWAGA! Doznałeś obrażeń, przez co nie możesz opuścić serwera, dopóki to", true, antyRelogWindow) 
text2AR = guiCreateLabel(0.07, 0.57, 0.93, 0.20, "okienko nie zniknie! W przeciwnym razie, twoja postać zostanie uśmiercona", true, antyRelogWindow) 
  
guiSetVisible (antyRelogWindow,false) 
  
function wlaczOkienko() 
  
guiSetVisible (antyRelogWindow,true) 
  
  
end 
addEvent("wlaczInfo",true) 
addEventHandler ("wlaczInfo", getRootElement(), wlaczOkienko) 
  
  
function wylaczOkienko() 
  
guiSetVisible (antyRelogWindow,false) 
  
  
end 
addEvent("wylaczInfo",true) 
addEventHandler ("wylaczInfo", getRootElement(), wylaczOkienko) 
  
  
  

Link to comment

You can try this, but idk if it works.

addEventHandler("onPlayerDamage",root, 
    function () 
        p = source 
        timer = setTimer( 
            function () 
                addEventHandler("onPlayerLogout",p, 
                    function () 
                        outputChatBox("You cannot logout for another "..getTimerDetails(timer) / 1000 .." seconds.",p,255,0,0) 
                        cancelEvent() 
                    end 
                ) 
            end, 1000, 1 
        ) 
    end 
) 
  

Link to comment

You can try this, but idk if it works. 
LINE NUMBER ON/OFF | EXPAND/CONTRACT | SELECT ALL 
addEventHandler("onPlayerDamage",root, 
    function () 
        p = source 
        timer = setTimer( 
            function () 
                addEventHandler("onPlayerLogout",p, 
                    function () 
                        outputChatBox("You cannot logout for another "..getTimerDetails(timer) / 1000 .." seconds.",p,255,0,0) 
                        cancelEvent() 
                    end 
                ) 
            end, 1000, 1 
        ) 
    end 
) 

Help . It does not work. Someone will do it for me? Very you please.

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...