Lord Ganja Posted April 22, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Share Posted April 22, 2015 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! Quote Link to comment Share on other sites More sharing options...
Jey Posted April 23, 2015 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 249 Reputation: 73 Joined: 10/20/12 Last Seen: August 16, 2018 Share Posted April 23, 2015 (edited) Thanks for this. Anyway what if I added some announcement. announcing the name of the selected player '.@pm_aid' ? np ^^ Just attach to the player and use strcharinfo like this: set .@pid,getcharid(1); //Set Party Id getpartymember .@pid,2; //Get Party Information while(1) { //Loops until a Player gets the item detachrid; //Detach from the first player set .@pm_aid,$@partymemberaid[rand($@partymembercount)]; //Saves the Account ID of the random Member if( attachrid(.@pm_aid) ) { //Just to be sure he is in the same party and not logged with another character if( getcharid(1) != .@pid ) continue; //Online, attached and in the same party: announce strcharinfo(0)+" has got the item.",bc_all; getitem 502,1; break; } } Edited April 24, 2015 by Jey 1 Quote Link to comment Share on other sites More sharing options...
Jey Posted April 22, 2015 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 249 Reputation: 73 Joined: 10/20/12 Last Seen: August 16, 2018 Share Posted April 22, 2015 (edited) set .@pid,getcharid(1); //Set Party Id getpartymember .@pid,2; //Get Party Information while(1) { //Loops until a Player gets the item set .@pm_aid,$@partymemberaid[rand($@partymembercount)]; //Saves the Account ID of the random Member if( isloggedin(.@pm_aid) ) { getitem 502,1,.@pm_aid; break; } } Edited April 23, 2015 by Jey Quote Link to comment Share on other sites More sharing options...
Lord Ganja Posted April 22, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share Posted April 22, 2015 set .@pid,charid(1); //Set Party Id getpartymember .@pid,2; //Get Party Information while(1) { //Loops until a Player gets the item set .@pm_aid,$@partymemberaid[rand($@partymembercount)]; //Saves the Account ID of the random Member if( isloggedin(.@pm_aid) ) { getitem 502,1,.@pm_aid; break; } } Thanks for this. Anyway what if I added some announcement. announcing the name of the selected player '.@pm_aid' ? Quote Link to comment Share on other sites More sharing options...
Lord Ganja Posted April 23, 2015 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share Posted April 23, 2015 Thank you so much Jey! Quote Link to comment Share on other sites More sharing options...
Jey Posted April 24, 2015 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 249 Reputation: 73 Joined: 10/20/12 Last Seen: August 16, 2018 Share Posted April 24, 2015 You're welcome ^^ Quote Link to comment Share on other sites More sharing options...
Question
Lord Ganja
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.