Jump to content
  • 0
Lord Ganja

script that select random member from a party

Question

Can anyone provide me a script that will select a random player from a party?

 

I am currently making a script that will select a random player from a party and give a reward to the selected party member.

 

Thanks in advance!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Thanks for this. /no1

Anyway what if I added some announcement.

announcing the name of the selected player '[email protected]_aid' ?

np ^^

Just attach to the player and use strcharinfo like this:

set [email protected],getcharid(1); //Set Party Id
getpartymember [email protected],2; //Get Party Information
while(1)
{ //Loops until a Player gets the item
    detachrid; //Detach from the first player
    set [email protected]_aid,[email protected][rand([email protected])]; //Saves the Account ID of the random Member
    if( attachrid([email protected]_aid) )
    {
        //Just to be sure he is in the same party and not logged with another character
        if( getcharid(1) != [email protected] )
            continue;
        //Online, attached and in the same party:
        announce strcharinfo(0)+" has got the item.",bc_all;
        getitem 502,1;
        break;
    }
}
Edited by Jey
  • Upvote 1
Link to comment
Share on other sites


set [email protected],getcharid(1); //Set Party Id

getpartymember [email protected],2; //Get Party Information

while(1)

{ //Loops until a Player gets the item

set [email protected]_aid,[email protected][rand([email protected])]; //Saves the Account ID of the random Member

if( isloggedin([email protected]_aid) )

{

getitem 502,1,[email protected]_aid;

break;

}

}

Edited by Jey
Link to comment
Share on other sites

set [email protected],charid(1); //Set Party Id
getpartymember [email protected],2; //Get Party Information
while(1)
{ //Loops until a Player gets the item
	set [email protected]_aid,[email protected][rand([email protected])]; //Saves the Account ID of the random Member
	if( isloggedin([email protected]_aid) )
	{
		getitem 502,1,[email protected]_aid;
		break;
	}
}

Thanks for this. /no1

Anyway what if I added some announcement.

announcing the name of the selected player '[email protected]_aid' ?

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.