!!! EDIT = This script was found in Bukz CubeScript tutorial, though he claims he didn't make it. If you made it please tell me so I can give you some credit :P !!!
If you ever get the "flag bug" (when you can't see the flag), then simply type /reconnect.
If you ever get the "flag bug" (when you can't see the flag), then simply type /reconnect.
[SELECT ALL] Code:
// Put the following code into your autoexec.cfg - and use the newly created /reconnect command to quickly disconnect & reconnect to the server that you are currently on. As with any other alias/command, you may bind it to a key.
alias "reconnect" [
if ( = $connected 1 ) [ // We'll learn more about if statements in the next tutorial, but this simply checks to make sure you are connected to a server.
curserverip = (curserver 1) // Get the IP of the server you are on.
curserverport = (curserver 3) // Get the port of the server you are on.
disconnect // Disconnect
connect $curserverip $curserverport // Use the info to reconnect to the server.
][
echo "You must be connected before you can reconnect!" // Else, warn the user that they must be connected for the script to work properly. This only happens if the if statement above fails - or in plain english - you'll see this warning if you are not connected to a server and try using this script. Don't worry yourself much with if statements now, they can only lead to flustration for a beginner scripter, we need to learn the basics before we go into things such as flow control.
]]