Jump to content

Anti Logout


lubiekeppa

Recommended Posts

Posted

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) 
  
  
  

Posted

To cancel logout, use the function and event posted above.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Try to make it -_-"

And if you couldn't, Post it here and we'll help ^^

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

Post what you have done !

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

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 
) 
  

Posted

That'll create a single timer variable, he should use a table, and no need to create the function every time.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

Posted

No one will do it for you. Just try to do it and tell us what the problem.

Please do not PM me with scripting related question nor support, use the forums instead.

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