Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

[c++]Check PvP


FlorinMarian

Question

  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 0

I  can guess the problem but i prefer looking on skype. In char item usually an item is selected, but your "isfight" method is surely related to a character, so you have to call it from a char instance(bad engl). I'll try to help you on skype -> xelbrujoox

Link to comment
Share on other sites

  • 0
  • Premium
Acum 9 ore, Root a spus:

if you trying to restrict something when in duel you can check my thread here some use of the functions

  Reafișează conținuturi ascunse

 

 

It's a good point but i want to check if autopotion it's enabled.

Try to check with

if (FindAffect(AFFECT_AUTO_HP_RECOVERY) || FindAffect(AFFECT_AUTO_SP_RECOVERY))

but don't succeed.

Link to comment
Share on other sites

  • 0
  • Premium

  This is the only way to use IsFight but you need to find victim

 CPVP kPVP(GetPlayerID(), pkVictim->GetPlayerID());
 CPVP * pkPVP = Find(kPVP.m_dwCRC);

if (pkPVP || pkPVP->IsFight())

Link to comment
Share on other sites

  • 0
7 hours ago, FlorinMarian said:

It's a good point but i want to check if autopotion it's enabled.

Try to check with

if (FindAffect(AFFECT_AUTO_HP_RECOVERY) || FindAffect(AFFECT_AUTO_SP_RECOVERY))

but don't succeed.

Try this 

Spoiler
LPCHARACTER pkChr;//Setting pinter for char class
int blocked_items[] = {72723,  72724, 72725, 72726};//Banned potions

for(size_t i = 0; i < INVENTORY_MAX_NUM; i++) //Running ineventory scan
{
for (size_t id = 0; id < 4; id++) 
{
if(pkChr->GetInventoryItem(i)> 0 && pkChr->GetInventoryItem(i)->GetSocket(0) == 1 && pkChr->GetInventoryItem(i)->GetVnum() == blocked_items[id])
{
			pkChr->ChatPacket(CHAT_TYPE_INFO, "%s Potion detected" , pkChr->GetName());
			return false;//Stoping code here
}

 

 

Link to comment
Share on other sites

  • 0
  • Premium
1 oră în urmă, Root a spus:

Try this 

  Ascunde conținuturi

LPCHARACTER pkChr;//Setting pinter for char class
int blocked_items[] = {72723,  72724, 72725, 72726};//Banned potions

for(size_t i = 0; i < INVENTORY_MAX_NUM; i++) //Running ineventory scan
{
for (size_t id = 0; id < 4; id++) 
{
if(pkChr->GetInventoryItem(i)> 0 && pkChr->GetInventoryItem(i)->GetSocket(0) == 1 && pkChr->GetInventoryItem(i)->GetVnum() == blocked_items[id])
{
			pkChr->ChatPacket(CHAT_TYPE_INFO, "%s Potion detected" , pkChr->GetName());
			return false;//Stoping code here
}

 

 

haha, great bro but i wanna disable some functions while autopotions are enabled, not only blocking potions use.

Thank you !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 1

      Metin2 TitleBar Move Frezze

    2. 1

      Metin2 TitleBar Move Frezze

    3. 0

      Navicat "Trial" Reset

    4. 13

      Item ToolTip Width Fix

    5. 0

      Guild icon wrong position

    6. 3

      Monster health

    7. 4

      Luffy Pet

    8. 38

      Core X → Top Metin2 & Metin2 Download → Changelogs

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.