Jump to content

give item to party members


Go to solution Solved by Syreldar,

Recommended Posts

  • Honorable Member
  • Solution
for _, pid in ipairs({party.get_member_pids()}) do
    q.begin_other_pc_block(pid);
    --
    pc.give_item2(vnum, quantity);
    --
    q.end_other_pc_block();
end -- for

?

Edited by Syreldar
  • Metin2 Dev 1
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/32826-give-item-to-party-members/#findComment-166221
Share on other sites

thank you very much,

the weird thing is that i did try that but instead i put it inside 'questlib.lua' 

so i can use it as a function like this for example: give_item_to_party (19) 

but it didn't work for me for some reason i don't know what, 

i did add it in: quest_functions.py 

but now i used it inside the quest and it did work perfectly.

Link to comment
https://metin2.dev/topic/32826-give-item-to-party-members/#findComment-166227
Share on other sites

one more question

why when i do it like that only one player gets the item ?

for _, pid in ipairs({party.get_member_pids()}) do
	q.begin_other_pc_block(pid);
	--
	if (pc.getqf ("member") == 1) then
		pc.give_item2(19, 1);
	end
	--
	q.end_other_pc_block();
end -- for

 

i checked that all players have the quest flag 'member' but still only one player gets it

Edited by Muffins
Link to comment
https://metin2.dev/topic/32826-give-item-to-party-members/#findComment-166228
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.