Jump to content

Script /exit ERROR


Dinossauro

Recommended Posts

Hello

I made a script that is, when a player writes in chat: / exit, a message appears: "You will leave in 5 seconds." And this time he spent out of the server!

addCommandHandler ( "exit", kickPlayerHandler ) 
function KickPlayer 
    outputChatBox ( You will leave the server, in 5 seconds ) 
end 
setTimer ( KickPlayer, 5000, 1, "You came out successfully." ) 
function kickPlayerHandler ( sourcePlayer, commandname, kickedname, reason ) 
kickPlayer ( kicked, sourcePlayer, reason ) 

But it does not work, help me!

Link to comment

learn scripting

function KickPlayer(thePlayer,reason) 
    kickPlayer ( thePlayer, "Console", reason ) 
end 
  
function kickPlayerHandler ( sourcePlayer, commandname, kickedname, reason ) 
    local reason = "You came out successfully." 
    outputChatBox ( "You will leave the server, in 5 seconds" ) 
    setTimer ( KickPlayer, 5000, 1, sourcePlayer,reason ) 
end 
addCommandHandler ( "exit", kickPlayerHandler) 

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