Jump to content

Recommended Posts

Posted
6 hours ago, LucasDesigner said:
DOES ANYONE HAVE A TIME SERVER CODE
C++

EnterWorld L2OFF
"SVR The current server time is " + fmt.format(new Date(System.currentTimeMillis())));
 

its easy to do , playeraction onEnter and place the code...

Posted
10 hours ago, Banshee Garnet said:

its easy to do , playeraction onEnter and place the code...

code above is not c++
code above is java

"SVR The current server time is " + fmt.format(new Date(System.currentTimeMillis())));

I want code in c++ can you

Posted
13 hours ago, LucasDesigner said:

code above is not c++
code above is java

"SVR The current server time is " + fmt.format(new Date(System.currentTimeMillis())));

I want code in c++ can you

you missunderstood me, place the code in the onEnter, it is just one line to make it , you dont know how to make the code? 

Posted (edited)
#include <ctime>

bool PlayerAction::OnEnterWorld(User *pUser)
{
	if(pUser->ValidUser())
	{

        std::time_t currentTime = std::time(NULL);
        std::wstringstream wss;
        wss << L"SVR The current server time is " << std::ctime(&currentTime);
        std::wstring formattedTime = wss.str();

        pUser->SendSystemMessage(formattedTime.c_str());

 

L2OFF Time.png

 

Free gift, i wish you to have happy new year!

Edited by ZOUMHS
  • Like 1
Posted
46 minutes ago, ZOUMHS said:
#include <ctime>

bool PlayerAction::OnEnterWorld(User *pUser)
{
	if(pUser->ValidUser())
	{

        std::time_t currentTime = std::time(NULL);
        std::wstringstream wss;
        wss << L"SVR The current server time is " << std::ctime(&currentTime);
        std::wstring formattedTime = wss.str();

        pUser->SendSystemMessage(formattedTime.c_str());

 

L2OFF Time.png

 

Free gift, i wish you to have happy new year!

i already coded it for him too 

 

+#include <iostream>
+#include <ctime>
+#include <vector>

playeraction.cpp

onenterworld bool

+        std::time_t currentTime = std::time(0);

+        std::string timeString = std::ctime(&currentTime);

+        std::wstring wTimeString(timeString.begin(), timeString.end());

+        std::wstring combinedMessage = L"SVR Time: " + wTimeString;

+        std::vector<wchar_t> pwCombinedMessage(combinedMessage.begin(), combinedMessage.end());
+        pwCombinedMessage.push_back(L'\0');  // Null-terminate the string

+        pUser->SendSystemMessage(&pwCombinedMessage[0]);

Sem_titulo.png

  • Like 1
Posted
On 12/30/2023 at 6:29 PM, ZOUMHS said:
#include <ctime>

bool PlayerAction::OnEnterWorld(User *pUser)
{
	if(pUser->ValidUser())
	{

        std::time_t currentTime = std::time(NULL);
        std::wstringstream wss;
        wss << L"SVR The current server time is " << std::ctime(&currentTime);
        std::wstring formattedTime = wss.str();

        pUser->SendSystemMessage(formattedTime.c_str());

 

L2OFF Time.png

 

Free gift, i wish you to have happy new year!

 

I wanted to know why the code leaves this space

 

maxch.png

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


  • Posts

    • 🏰 Clan Donations System – Power Through Unity This system allows clan members to support their clan directly through donations, turning contribution into strength.   How it works: Every donation made by a clan member is automatically listed in the clan donation panel. Each donation is permanently linked to the clan — no loss, no reset. The Clan Leader manages rewards manually for full transparency.   🎁 Clan Donation Rewards For every donation: The clan receives 5% Real Money or 10% Donate Coins (Leader chooses how the reward is given)   📌 After the reward is delivered, the donation is marked as PAID in the system. 🧾 Full Transparency Player name Donation amount Reward value (Real / Donate Coins) Date & status (Pending / Paid)   Everything is visible. Everything is tracked. Nothing is forgotten.   ⚔️ Support your clan. Strengthen your alliance. Power is built — not given.   https://www.l2dead.com/ https://discord.gg/TGnATuZmdt
    • up  corrected some retail crashes and hooked some new memory adresses that were missing  fix some missing retail behaviors on some recipes , you can also get the server as c4 with fixed scripts fully retail  what has been done to the c4  ( client is already configured) totally fixed npcposes  totally fixed raidbosses and minions bugged quests are fixed (known) a lot of recipes that were wrong  wrong values in several stats and corrected hero weapons behaviors/atk range
    • ποιο ειναι αρχαιο ακριβως? εκανες τον κοπο να ανοιξεις τα λινκς που εστειλα? 
    • Rates: xp45x / sp50x / adena50x (all adena is divided by 100/all shops prices too) Server: Full Official interlude server  with custom modifications Gameplay: l2Gold weapons - jewels, Buffs 1 hour, rebirth, No class change quests, increased movement speed on all classes   Download patch here: https://mega.nz/file/oZdG2KTa#1uTYSyEkNQV9U0Zxj-KLDE88mLj4pzQJZSYs2k3tpzo   Our server is waiting for all Lineage 2 fans who want to relive the good old days. This server is non-profit and fully dedicated to the community. There is no corruption, no pay-to-win, and no hidden agendas—just pure classic L2 fun.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..