Jump to content

Frozen

Inactive Member
  • Posts

    199
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by Frozen

  1. On 12/28/2015 at 8:22 PM, Tasho said:

     Click metin2client.exe and it skips to loadingphase? maybe you mean that I can make some shi.t that autologin on the last account ... I didn't nothing that skips like that.

    But for example if I want to code a taskbar and I want not to start and close the client every 1 min ... how can I do that?

    I don't know how to do that, but i will search.

  2. 41 minutes ago, NewWars said:

    Actually i did it other way, and pc.select really selects a PC, but when you do set_quest_state on other PC, "when enter" doesnt rly work.

    I have pc.selected the person and then i warped them to the same place, and it worked.

    Thanks for the help anyway.

    Yes thats because its a pc function. (pc.warp)

    But you cant use chat functions or item functions...

    PS: my bad i expressed wrong in the other post.

  3. 1 hour ago, NewWars said:

    You are right but, i putted this to debug on StartCoOp() after pc.select(): chat(""..registeredList.."is entering Co-Op: Index"..i)

    But it gives me 2 times on the last registering like this:

    MPPBydp.jpg

    And just the last character, in this case Slot2, goes to "run" state.

    It sould show on each character, and not on the last entering person right?

    I presume is set_quest_state problem.

    I think what pc.select does is to only select the person infos, not interact with the person.

  4. 1 hour ago, Ken said:

     

    
    quest co_mission begin
    	state start begin
    		function StartCoOp()
    			for i = 1, table.getn(registeredList), 1 do
    				pc.select(find_pc_by_name(registeredList[i])) -- It's an array.
    				set_quest_state("co_mission", "run")
    			end
    		end
    		when NPC_ID.chat."Register for CO-Op" begin
    			say_title("Co-Op:")
    			say("")
    			--"1234567890"
    			say("Do you wanna register for Co-op?")
    			if (select(locale.yes, locale.no) == 2) then return end
    			table.insert(registeredList, pc.get_name())
    			if (table.getn(registeredList) == 2) then
    				co_mission.StartCoOp()
    			end
    		end
    	end
    	
    	state run begin
    		notice_in_map(string.format("The player %s entered Co-Op mission", pc.name))
    	end
    end
    
    You're creating a table in the questlib.lua and you're using for-loop to call the names and select them. If you don't add that just like that, your quest is only call the first member or the last number. (I never test that) Whatever, your quest should be just like that.
    

    Kind Regards ~ Ken

     

    That quest will only work with 2 people at the same time.

    Try this:

     

    quest co_mission begin
    	state start begin
    		function checkAvailable()
    			local slotAvailable = 0
    			for i = 1, table.getn(allRegisteredList), 1 do
    				if table.getn(allRegisteredList[i]) < 2 then 
    					for a=1, table.getn(allRegisteredList[i], 1 do
    						local findPC = find_pc_by_name(allRegisteredList[i][a])
    						if findPC ~= 0 then slotAvailable = i break end
    					end
    				end
    			end
    			
    			return slotAvailable
    		end
    		
    		
    		function StartCoOp(slot)
    			for i = 1, table.getn(allRegisteredList[slot]), 1 do
    				pc.select(find_pc_by_name(allRegisteredList[slot])) -- It's an array.
    				set_quest_state("co_mission", "run")
    			end
    		end
    		
    		when NPC_ID.chat."Register for CO-Op" begin
    			say_title("Co-Op:")
    			say("")
    			--"1234567890"
    			say("Do you wanna register for Co-op?")
    			if (select(locale.yes, locale.no) == 2) then return end
    			local slot = co_mission.checkAvailable()
    			if slot == 0 then table.insert(allRegisteredList, {pc.name})
    			else table.insert(allRegisteredList[slot], pc.name) co_mission.StartCoOp(slot) end
    		end
    	end
    	
    	state run begin
    		notice_in_map(string.format("The player %s entered Co-Op mission", pc.name))
    	end
    end
    
     (I didn't test it yet)
  5. if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true))
            {
                addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel();
            }
            else
            {
                addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel() : 0;
            }addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel() : 0;

    Delete this /\ and put this V:

    addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel() : 0;

    But you dont need to make the code like this, this is just a way to optimize the code, you can put like is in avenue topic.

    • Love 1
  6. 15 minutes ago, BackPlayer said:

    like this?  cause i am noob...

      Hide contents

    if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true))
            {
                addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel();
            }
            else
            {
                addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel() : 0;
            }

     

    No instead of the if statement just put this: What this is doing is the same as the if statement: (the checks) ? (what is equal case true) : (what is equal case false);

    addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel() : 0;
  7. Try this;

    • search for:

    bool CExchange::Done()

    • replace this:

     if (m_lGold)
        {
            GetOwner()->PointChange(POINT_GOLD, -m_lGold, true);
            victim->PointChange(POINT_GOLD, m_lGold, true);

            if (m_lGold > 1000)
            {
                char exchange_buf[51];
                snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", GetOwner()->GetPlayerID(), GetOwner()->GetName());
                LogManager::instance().CharLog(victim, m_lGold, "EXCHANGE_GOLD_TAKE", exchange_buf);

                snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", victim->GetPlayerID(), victim->GetName());
                LogManager::instance().CharLog(GetOwner(), m_lGold, "EXCHANGE_GOLD_GIVE", exchange_buf);
            }
        }

    • with this:

     if (m_lGold)
        {
            if (m_lGold > 0)
            {
                GetOwner()->PointChange(POINT_GOLD, -1*m_lGold, true);
                victim->PointChange(POINT_GOLD, m_lGold, true);

                if (m_lGold > 1000)
                {
                    char exchange_buf[51];
                    snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", GetOwner()->GetPlayerID(), GetOwner()->GetName());
                    LogManager::instance().CharLog(victim, m_lGold, "EXCHANGE_GOLD_TAKE", exchange_buf);

                    snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", victim->GetPlayerID(), victim->GetName());
                    LogManager::instance().CharLog(GetOwner(), m_lGold, "EXCHANGE_GOLD_GIVE", exchange_buf);
                }
            }
        }

  8. You have some errors there:

    Failed to load image (filename: locale/tr/ui/login/status/DOWN.tga)
    • Means you dont have DOWN.tga file in that location so you need to put it there or change the path.
    inconsistent use of tabs and spaces in indentation
    
    • Means you are messing around with tabs and spaces (use 4 spaces and use tab)
    'NoneType' object has no attribute 'SetToolTipText'
    • That error apears because some previous error is blocking it from loading taskbar
    • Love 1
  9. 1 hour ago, Sydai said:

    Thanks, but i have that file there and still nothing, the error persists.

    See if this helps: https://msdn.microsoft.com/en-us/library/et4zwx34.aspx

    I think what can be is:

    • The file, the directory, or the disk is read-only.
    • Access permissions for the file or the directory are not granted.

    If you cant find a solution try to make some modifications to the code so you dont use that include file.

×
×
  • 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.