I'm trying to make a script wherein an item is randomly given to a person inside a party, however, I have no idea as to how to remove the person from the list if he's offline or if he's not in the same map as the person who killed the mob, if any small snippet or hint is given, I would really appreciate it.
Thanks in advance.
I had an experiement before and came up with this, but I don't think it's really that good, nor does it exclude offline members or members outside of the map.
getpartymember .@partyid,2;
.@rand = rand($@partymembercount);
.@getsloot = $@partymemberaid[.@rand];
getpartymember .@partyid,0;
.@getname$ = $@partymembername$[.@rand];
dispbottom "Loot has been assigned to: "+$@partymembername$[.@rand];
detachrid;
attachrid(.@getsloot);
.@cid = getcharid(0,.@getname$);
if(strcharinfo(3,.@cid) != .@map_name$){
dispbottom "You failed to get the item because you are not in the same map as your party members.";
end;
}
Question
Hijirikawa
I'm trying to make a script wherein an item is randomly given to a person inside a party, however, I have no idea as to how to remove the person from the list if he's offline or if he's not in the same map as the person who killed the mob, if any small snippet or hint is given, I would really appreciate it.
Thanks in advance.
I had an experiement before and came up with this, but I don't think it's really that good, nor does it exclude offline members or members outside of the map.
getpartymember .@partyid,2; .@rand = rand($@partymembercount); .@getsloot = $@partymemberaid[.@rand]; getpartymember .@partyid,0; .@getname$ = $@partymembername$[.@rand]; dispbottom "Loot has been assigned to: "+$@partymembername$[.@rand]; detachrid; attachrid(.@getsloot); .@cid = getcharid(0,.@getname$); if(strcharinfo(3,.@cid) != .@map_name$){ dispbottom "You failed to get the item because you are not in the same map as your party members."; end; }
Link to comment
Share on other sites
6 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.