Cuberite Forum
Built-in commands - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Built-in commands (/thread-248.html)



Built-in commands - cedeel - 12-29-2011

Browsing the source, I found a cmd called /coords

Should this be moved to a plugin?
It doesn't show up using /help


RE: Built-in commands - Kwen - 12-29-2011

All commands are in lua. If you really need to check for coords, press F3 and it pops up on the left corner.


RE: Built-in commands - cedeel - 12-29-2011

Code:
bool cServer::Command( cClientHandle & a_Client, const char* a_Cmd )
{
    cPluginManager* PM = cRoot::Get()->GetPluginManager();
    if( PM->CallHook( cPluginManager::E_PLUGIN_CHAT, 2, a_Cmd, a_Client.GetPlayer() ) )
        return true;

    std::string Command( a_Cmd );
    if( Command.length() <= 0 ) return false;
    if( Command[0] != '/' ) return false;

    std::vector< std::string > split = StringSplit( Command, " " );
    if( split.size() == 0 )
        return false;

    if( split[0].compare("/coords") == 0 )
    {
        char c_Str[128];
        sprintf_s( c_Str, 128, "[X:%0.2f] [Y:%0.2f] [Z:%0.2f]", a_Client.GetPlayer()->GetPosX(), a_Client.GetPlayer()->GetPosY(), a_Client.GetPlayer()->GetPosZ() );
        a_Client.Send( cPacket_Chat( cChatColor::Green + c_Str ) );
        return true;
    }
    return false;
}

This isn't lua by any means. Taken from cServer.cpp


RE: Built-in commands - Lapayo - 12-29-2011

Yes, I think this should be moved to a plugin or removedBig Grin

Seems to be old debugging codeBig Grin


RE: Built-in commands - FakeTruth - 12-29-2011

Yes it should be removed, it was from the time that F3 didn't even exist in the game