Jump to content

Offlineshop duplicate item ERROR(change channel)


Recommended Posts

  • Premium

The majority of them are blocked,  the thing is, when you're already changing the channel you cannot stop it because you can even tap OK after the "1s" cooldown timer has passed.

The second one is with the add item, you can close the offlineshop window and remain only with the inputdialog, you can press OK and repeat the same steps, press on change channel, OK and it duplicates it.

Link to comment
Share on other sites

  • Active+ Member

I speak about source server side checks , not python ... 

Take : SetExchangeTime() // GetExchangeTime() like example.

Spoiler

//char.h
		int		GetOpenMyShopTime() const { return m_iOpenMyShopTime; }
		void	SetOpenMyShopTime() { m_iOpenMyShopTime = thecore_pulse() + PASSES_PER_SEC(10); }
		int		m_iOpenMyShopTime;
		
//char.cpp
//Search:
	m_iExchangeTime = 0;
//Add after:
	m_iOpenMyShopTime = 0;

//char.cpp
//In "CHARACTER::OpenMyShop" add: (after create shop)
	SetOpenMyShopTime();

//In function that add new item put that:
	SetOpenMyShopTime();
	// or like that ch->SetOpenMyShopTime();
		
//In your change channel function add that check:
	if (ch->GetOpenMyShopTime() > thecore_pulse()) {
		ch->ChatPacket(CHAT_TYPE_INFO, "You can't change channel right now!");
		return;
	}
	
// For cancel change channel event after: (as i said up there)
	SetOpenMyShopTime();
//just add:
	event_cancel(&m_pkChangeChannelEvent);
	//m_pkChangeChannelEvent is your change channel name

 

 

  • Love 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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