Hello, I recently created a model to edit my config in xml, but I have a doubt, to restore the status of the players after restart you will have to create a loop? Because I don't think it would be a good idea to do that, I would like your opinion.
for (Vip vip : VipData.getInstance().getVip())
{
if (player.getMemos().getLong(vip.getType().toString(), 0) > 0)
{
long now = Calendar.getInstance().getTimeInMillis();
long endDay = player.getMemos().getLong(vip.getType().toString());
if (now > endDay)
player.deleteVip(vip.getType());
else
{
player.setVip(vip);
if (!vip.getMessage().isEmpty())
World.announceToOnlinePlayers(player.getClan() != null ? vip.getMessageClan().replace("%player%", player.getName()).replace("%clan%", player.getClan().getName()) : vip.getMessage().replace("%player%", player.getName()), true);
player.broadcastUserInfo();
}
}
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello.
1. Make sure to use in your xml:
<set name="usingServerSideName" val="true"/>
<set name="usingServerSideTitle" val="true"/>
2. And in npcname-e.dat do not use any name (not even a one space)
In my case 50011 is Agathion
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/hoodservices
https://campsite.bio/utchihaamkt
Question
Williams
Hello, I recently created a model to edit my config in xml, but I have a doubt, to restore the status of the players after restart you will have to create a loop? Because I don't think it would be a good idea to do that, I would like your opinion.
for (Vip vip : VipData.getInstance().getVip()) { if (player.getMemos().getLong(vip.getType().toString(), 0) > 0) { long now = Calendar.getInstance().getTimeInMillis(); long endDay = player.getMemos().getLong(vip.getType().toString()); if (now > endDay) player.deleteVip(vip.getType()); else { player.setVip(vip); if (!vip.getMessage().isEmpty()) World.announceToOnlinePlayers(player.getClan() != null ? vip.getMessageClan().replace("%player%", player.getName()).replace("%clan%", player.getClan().getName()) : vip.getMessage().replace("%player%", player.getName()), true); player.broadcastUserInfo(); } } }
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.