-
Posts
918 -
Joined
-
Days Won
877 -
Feedback
100%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Mali
-
-
#Update:
Edited stackable items
Sort Type->Alphabet fixed(string) also you can change for GetVnum()
- 1
- 4
-
-
app.GetTime() + second
-
2 hours ago, Raylee said:
Could you post maybe only the update?
I would be glad.
Best regards
RayleeI can't sorry :/ you need to change all server src side, delete old codes
- 1
-
Update:
#Exchange bug fixed
- 2
-
-
24 minutes ago, Nolwarg said:
for what you used comma in table??
For layout, you can delete commas
-
c++ version
#include <iostream> #include <ctime> using namespace std; int main() { srand( time( NULL ) ); char list[] = {"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y"}; int maxStr = 10; std::string random_word = ""; for (int i = 0; i < maxStr; ++i) { int randa = rand() % sizeof(list); if (list[randa] == ',') { i--; continue; } random_word += list[randa]; } cout<<random_word; return 0; }
-
1 minute ago, Dobrescu Sebastian said:
Yep, I noticed and corrected. I tested. It works ok. There would still be ok if we make a check for 0 message length.
Okey okay ok I will add but now I'm going to sleep
-
Thanks bro but this part is wrong
if (stch) { ..... .... stch->ChatPacket(CHAT_TYPE_WHISPER, "%s: %s", ch->GetName(), message.c_str()); ch->ChatPacket(CHAT_TYPE_WHISPER, "To %s: %s", stch->GetName(), message.c_str()); .... } else if (stch == ch)
You can use this:
if (stch) { if (stch == ch) bla bla ..... .... stch->ChatPacket(CHAT_TYPE_WHISPER, "%s: %s", ch->GetName(), message.c_str()); ch->ChatPacket(CHAT_TYPE_WHISPER, "To %s: %s", stch->GetName(), message.c_str()); .... }
-
1 hour ago, SergiuAndreiM said:
It's working but there's a problem..You can spam without geting kicked..can you put a timer?
Updated
-
7 hours ago, Mareq said:
Image not load
-
-
19 minutes ago, Fleon said:
s.every(1min, []() { CHAT_TYPE_NOTICE("MyNotice"); }); // Pseudocode
But you can't set settings from txt, if you know that use why do you wrote?
-
-
don't forget sysinstall/configure/Time Zone
After select UTC
-
19 minutes ago, Tasho said:
That's why metin2 is cancerous community..we stole code/ideas from another guys and put inside without any mention or thanks for it, doesn't importantly if you post free or not.
1.
void CTournamentPvP::Destroy() { ClearSTDMap(); if (running_event != NULL) { event_cancel(&running_event); running_event = NULL; } } void DestroyAutoNotice() { message_data.clear(); if (running_event != NULL) { event_cancel(&running_event); running_event = NULL; } }
2.
bool CTournamentPvP::Initialize() { if (running_event != NULL) { event_cancel(&running_event); running_event = NULL; } TournamentPvPInfoData* info = AllocEventInfo<TournamentPvPInfoData>(); info->pTournament = this; running_event = event_create(tournament_timer, info, PASSES_PER_SEC(30)); } void InitAutoNotice() { if (running_event != NULL) { event_cancel(&running_event); running_event = NULL; } AutoNoticeInfoData* info = AllocEventInfo<AutoNoticeInfoData>(); running_event = event_create(automatic_event_timer, info, PASSES_PER_SEC(1)); }
3.
void CheckAutoNotice() { time_t cur_Time = time(NULL); struct tm vKey = *localtime(&cur_Time); } void CTournamentPvP::PrepareAnnouncement() { time_t cur_Time = time(NULL); struct tm vKey = *localtime(&cur_Time); }
There are more..
You know very well about what i'm talking, already there exist more guys which take system a, b from C and make some changes and adapt it for another things.
I don't will talk about the rest of code which is already non-sense, already all people can see it.
Look:Already you and this guy stole the same concept of call event and check real time from Tournament PvP and do some changes, great coders.
Good luck "Developer of future."
Cry bitch
-
Spoiler
//syntax:
#NewNotice
# message yourmessage(._.->space)
# message secondmessage(._.->space)
# gmlvl GM_LEVEL(0-5)
# minlvl minumumlevel
# maxlvl maximumlevel
# mapidx forkedmapindex
# mapidx forkedmapindex
# chat_type Chat Type(0-4)
# day_type Day Type(0-1) 0->Month Days(0-31), 1->Week Days(0-6)
# date Day
# hour Hour
# min Minute
# end//Note: if you remove day, message will repeat everyday
//Note2: if you remove hour, message will repeat everyhour
//Note3: you can remove mapidx for everymap
//Note4: if you remove(chat_type, day_type, minlvl, maxlvl, gmlvl) system will reset default values
//Note5: you can add as many (messages, date, hour, min, mapidx) as you want- 4
- 5
-
10 minutes ago, Dobrescu Sebastian said:
Yes, but i saw others using it without the fix. And i was like " what the hell man, people just don't want to learn from the past "
Yes bro I can't learn anything from the past sorry
-
On 28.02.2018 at 4:23 PM, Dobrescu Sebastian said:
void MessengerManager::RemoveFromBlockList(MessengerManager::keyA account, MessengerManager::keyA companion)
You have to escape it. Haven't you learned anything from the past sql exploit ?
No, whatever
You know that bug fixed, you can fix like the messenger
-
2 minutes ago, hachiwari said:
std::string NumberToMoneyString(long long n) { std::string s; int cnt = 0; do { s.insert(0, 1, char('0' + n % 10)); n /= 10; if (++cnt == 3 && n) { s.insert(0, 1, '.'); cnt = 0; } } while (n); return s; }
whose better?
My codes better, you can use with int and char. Also shorter than this
- 1
-
You can use like this:
SpoilerNUMBER_TEXT("123456789")
NUMBER_TEXT_INT(123456789)
Locale.hpp add;
const char *locale_number(const char *string); const char *locale_number2(unsigned int mynumber); #define NUMBER_TEXT(str) locale_number(str) #define NUMBER_TEXT_INT(str) locale_number2(str)
Locale.cpp add;
#include <sstream> #include <string.h> using namespace std; const char * locale_number(const char *string2) { string str = string2; auto len = str.length(); auto counter = 2; while (counter < len) { if (counter % 3 == 0) str.insert(len - counter, "."); ++counter; } return str.c_str(); } const char * locale_number2(unsigned int mynumber) { stringstream strr; strr << mynumber; return locale_number(strr.str().c_str()); }
TEST IN SERVER:
auto gold = 10; ChatPacket(CHAT_TYPE_INFO, "We are testing(NUMBER_TEXT): %s", NUMBER_TEXT("123456789")); for (auto i : {10, 100, 1000, 10000, 500000}) { ch->ChatPacket(CHAT_TYPE_INFO, "We are testing(NUMBER_TEXT_INT): %s(i:%d)", NUMBER_TEXT_INT(gold*i), i); }
TEST:
#include <iostream> #include <string.h> using namespace std; #define NUMBER_TEXT(str) locale_number(str) #define NUMBER_TEXT_INT(str) locale_number2(str) const char *locale_number(const char *string); const char *locale_number2(int mynumber); const char * locale_number(const char *string2) { string str = string2; auto len = str.length(); auto counter = 2; /////// while (counter < len) { if (counter % 3 == 0) str.insert(len - counter, "."); ++counter; } return str.c_str(); } const char * locale_number2(int mynumber) { auto str = std::to_string(mynumber); return locale_number(str.c_str()); } int main () { auto gold = 10; for (auto i: {10, 100, 1000, 10000, 500000}) { cout << NUMBER_TEXT_INT(gold*i) << endl; } return 0; }
Test result:
- 1
-
32 minutes ago, .T4Ump said:
server side is usseles
but working
-
On 31.10.2017 at 8:33 PM, metin2-factory said:
Small update #2
If you have installed my official like new elemental bonuses. follow the small guide below to view element icon of a target that wears
the new rings, like in official.
open char.cpp,look for:
#ifdef ELEMENT_TARGET
replace the entire content of the #ifdef, until the #endif with the following:
#ifdef ELEMENT_TARGET p.bElement = 0; BYTE elementBase = 0; DWORD raceFlag; if (m_pkChrTarget) { if (m_pkChrTarget->IsMonster() && (raceFlag = m_pkChrTarget->GetMobTable().dwRaceFlag) >= RACE_FLAG_ATT_ELEC) { for (int i = RACE_FLAG_ATT_ELEC; i > 1; i /= 2) { elementBase++; } DWORD curElementBase = elementBase; const int ELEMENT_BASE_FLAG = pow(2, elementBase); for (int i = RACE_FLAG_ATT_ELEC; i <= RACE_FLAG_ATT_DARK; i *= 2) { curElementBase++; int diff = raceFlag - i; if (abs(diff) < ELEMENT_BASE_FLAG) break; } p.bElement = curElementBase - elementBase; } else if (m_pkChrTarget->IsPC()) { LPITEM pItem = m_pkChrTarget->GetWear(WEAR_RING1); if (pItem) { const int BASE_ELEMENT = APPLY_ATTBONUS_ELEC; for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++) { if (pItem->GetNewAttributeType(i) >= APPLY_ATTBONUS_ELEC && pItem->GetSocket(i) <= APPLY_ATTBONUS_DARK) { p.bElement = pItem->GetNewAttributeType(i) - BASE_ELEMENT + 1; break; } } } } } #endif
Compile server and that's it. now, when you select a target that wear a ring with elemental bonuses, an element icon will appear next to the target.
You can't use pow without float
const int ELEMENT_BASE_FLAG = pow((float)2, elementBase);
And why do you don't use ARMOR_PENDANT anyway thanks
Sort Inventory
in Features & Metin2 Systems
Posted
#Update:
Added Highlight system fix(not tested)
Removed "%s received", "Received Item: %s, %s " messages