12-29-2011, 12:14 PM
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