Jump to content

Question

Posted (edited)

hello guys i have created an mvp points npc, whell i have a question if its possible to share the points in party?

 

this is my points :

OnMvPKill:
set .MvpPoint,rand(150,300);
set MvpPoint,MvpPoint+.MvpPoint;
 

i need to share it for 5 party members in the same map

Edited by nhofije

2 answers to this question

Recommended Posts

Posted

Try this

if ( getcharid(1) ) {
	.@party_id = getcharid(1);
	.@map$ = strcharinfo(3);

	getpartymember .@party_id;
	getpartymember .@party_id, 2;

	.@count = $@partymembercount;
	copyarray .@aid, $@partymemberaid, .@count;
	copyarray .@name$, $@partymembername$, .@count;

	for ( ; .@i < $@partymembercount; .@i++ )
		if ( getcharid( 0,$@partymembername$[.@i] ) ) {
			getmapxy .@tmp$, .@x, .@y, 0, $@partymembername$[.@i];
			if ( .@tmp$ != .@map$ ) {
				deletearray .@aid[.@i], 1;
				deletearray .@name$[.@i], 1;
				.@count -= 1;
			}
		}
	while ( .@count > 5 ) {
		.@r = rand( .@count );
		deletearray .@aid[.@r], 1;
		deletearray .@name$[.@r], 1;
		.@count -= 1;
	}
	
	for ( .@i = 0; .@i < .@count; .@i++ ) {
		attachrid .@aid[.@i];
		set MvpPoint,MvpPoint+.MvpPoint;
	}
}
else
	set MvpPoint,MvpPoint+.MvpPoint;

The killer share the points with 5 players in the party, only if the member is online and on the same map

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...