Jump to content

Mali

Honorable Member
  • Posts

    919
  • Joined

  • Days Won

    887
  • Feedback

    100%

Posts posted by Mali

  1. Spoiler
    
    
    #include "map"
    enum Languages
    {
    	TR,
    	EN,
    	LANG_MAX,
    	DEFAULT_LANG = TR, // change lang or use your multilang func example: GetLang()
    };
    auto Translate(string input, int lang)
    {
    	using namespace std;
    	map<string, string> Langs[LANG_MAX];
    	Langs[TR]["TESTSTRING"] = "[TR]Test multilang";
    	Langs[EN]["TESTSTRING"] = "[EN]Test multilang";
       
    	if (not(Langs[lang].count(input)) or lang >= LANG_MAX) {
    		sys_err("Error in [%s], chat[%s]", __FUNCTION__, input.c_str());
    		return "error";
    	}
    	/* test only
    	auto Lang_Name = [](auto lang) -> string {
    		return lang == TR ? "TR" : "EN";
    	};
    	for (auto exist_langs : {TR, EN})
    		for (auto [inp,output] : Langs[exist_langs])
    			cout << "Lang:[" << Lang_Name(exist_langs) << "] " << "input: " << inp << " output: " << output << endl;
    	*/
    			
    	return Langs[lang][input].c_str();
    }

     

    Usage:

    ChatPacket(CHAT_TYPE_INFO, Translate("TESTSTRING", DEFAULT_LANG));

     

    • Love 1
  2. 7 hours ago, krokogames said:

    thanks but i have new error 

    can i replace code:  

    
      template <typename T> T MIN(T a, T b)
        {
            return a < b ? a : b;
        }
    
        template <typename T> T MAX(T a, T b)
        {
            return a > b ? a : b;
        }
    
        template <typename T> T MINMAX(T min, T value, T max)
        {
            T tv;
    
            tv = (min > value ? min : value);
            return (max < tv) ? max : tv;
        }

    to:  

    
     template <typename T> T _MIN(T a, T b)
        {
            return a < b ? a : b;
        }
    
        template <typename T> T _MAX(T a, T b)
        {
            return a > b ? a : b;
        }
    
        template <typename T> T _MINMAX(T min, T value, T max)
        {
            T tv;
    
            tv = (min > value ? min : value);
            return (max < tv) ? max : tv;
        }

     

     

    4hEp.png

    delete that codes from stl.h and use these:

    std::min

    std::max

    std::minmax

    note:

    #include <algorithm>
    • Love 1
  3. 9 minutes ago, Galet said:

    Hello,

    That's fine and great, but I don't get the point. I think using a decoration system like official servers did is better, I don't think a lot of people will disable terrain, water, trees or even clouds

    Good job anyway !

    Tomorrow, I will add hide shops and you can delete water etc. 

  4. 2 hours ago, WLsj24 said:

    Yes, the only problem is that if "Player1" is in Pyugmoo and "Player2" is in "Spider Dungeon", that is, the members of the party are in different core, (you know, cities are usually in the core1, and maps like Yongbi are usually in the core2) because in that case it will show the one in a different cores as [Offline] (even if both members are online) in the party. If @Mali61 fix that, then one could already speak of a functional version without bugs.

    Please wait weekend I'm busy

    • Love 3
  5. 18 hours ago, DeadSkull7 said:

    Good job but i think if same player open shop don't increment seens counter will be better.Also, why you use vector ? And push every time ? in you case you don't want to chack if player opened shop or no to increment counter ! You can use single counter not vector.

    
    int counter = 0;

     

    -And push every time ?

    Wrong! Not every time if ch isn't exist in vector control:

    find(looked.begin(), looked.end(), ch) == looked.end()

  6. 16 hours ago, ReFresh said:

    @Mali61 When I used the key and I have opened all slots I got 3 popout dialogs after yourself.

    Dialogs for yes selection:

    1st dialog translation  - To open next slot you need none x keys - so it can't detect how many keys you need to open slot because you have already opened all slots

    2nd dialog translation - You have already opened all slots. (was really hard to see in the video because it disappeared fast - but you can make video slower on youtube)

    3rd dialog translation - You don't have needed amount of keys to open next slot

    4th dialog translation - You have already opened all slots.

    Dialog for no selection:

    1st dialog translation - To open next slot you need none x keys - so it can't detect how many keys you need to open slot because you have already opened all slots

    2th dialog translation - You have already opened all slots.

    PS: No erros in sysser.

    Video:

      Reveal hidden contents

     

     

    Fixed and added english lc (change uiinventory, game.py locale_game.txt)

    • Love 1
  7. On 13.07.2017 at 1:42 AM, Denis said:

    Wouldn't it be better to store the "Guests" inside a vector and then check if the guest already exists in it, if yes don't add the guest to vector, if no add it to vector then send to client?

    I'm just narrow-minded when it comes to quest flags haha :D

    You're right.I updated topic.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.