Jump to content

Recommended Posts

  • Premium

Hello !

I try to use a function from pvp.cpp on char_item.cpp and using this simple checkup:

if(IsFight())

I get error 

error: 'IsFight' was not declared in this scope

I've included "pvp.h" on header. Any idea ? Thank you !

Link to comment
https://metin2.dev/topic/16524-ccheck-pvp/
Share on other sites

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
https://metin2.dev/topic/16524-ccheck-pvp/#findComment-91386
Share on other sites

  • 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
https://metin2.dev/topic/16524-ccheck-pvp/#findComment-91431
Share on other sites

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
https://metin2.dev/topic/16524-ccheck-pvp/#findComment-91437
Share on other sites

  • 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
https://metin2.dev/topic/16524-ccheck-pvp/#findComment-91438
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.