Jump to content

Recommended Posts

Hey developers

im looking for a function in Python that checks if a item has 1-5 attributes.

 

since getitemattribute in pythonplayer doesn’t work idk..

 

i hope I get some help @VegaS™@martysama0134 @Syriza

  • Forum Moderator
On 11/3/2019 at 11:13 PM, Syriza said:

i hope I get some help  @Syriza

slotIndex = Your index position from inventory.

Python

import player

attrCount = 0
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
	if player.GetItemAttribute(player.INVENTORY, slotIndex, i):
		attrCount += 1

print(attrCount)

C++

This is the hidden content, please

 

Edited by VegaS™
added c++ version
  • Metin2 Dev 23
  • Good 5
  • Love 10
vor 2 Minuten schrieb VegaS™:

slotIndex = Your index position from inventory.


import player

attrCount = 0
for i in xrange(player.ATTRIBUTE_SLOT_NORM_NUM):
	if player.GetItemAttribute(slotIndex, i):
		attrCount += 1
		
if attrCount:
	print ("why you quote yourself, wtf")

 

:D ❤️

  • Active+ Member
7 hours ago, Syriza said:

@VegaS™

 

oh I see you added the c++ version thanks sensei but how can i use it ? :o

You will use the function like offical to show on the item :

You can add more bonus like 6/7?

  • Forum Moderator

5SKFcab.png qitNeab.png gq6ofab.png

This is the hidden content, please

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 12
  • Sad 1
  • Scream 1
  • Good 6
  • Love 11

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.