pajodex Posted January 11, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Share Posted January 11, 2018 Hi, Is is possible to attach a OnPCKillEvent/OnPCDieEvent to the leader of party? Thanks! Quote Link to comment Share on other sites More sharing options...
1 crazyarashi Posted January 11, 2018 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 776 Reputation: 239 Joined: 02/11/17 Last Seen: 13 hours ago Share Posted January 11, 2018 (edited) - script DieDieDie -1,{ OnPCDieEvent: .@party_id = getcharid(1); if (getcharid(0) != getpartyleader(.@party_id,2)) { end; } mapannounce strnpcinfo(4),"The party leader of "+getpartyname(.@party_id)+" has died in battle. ",0,"0x00ff99"; end; } Edited January 11, 2018 by crazyarashi 1 Quote Link to comment Share on other sites More sharing options...
0 pajodex Posted January 11, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Author Share Posted January 11, 2018 Cool, Will try this soon. What if there are two parties? Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted January 11, 2018 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 776 Reputation: 239 Joined: 02/11/17 Last Seen: 13 hours ago Share Posted January 11, 2018 1 minute ago, pajodex said: Cool, Will try this soon. What if there are two parties? this will apply to all party leaders of any party Quote Link to comment Share on other sites More sharing options...
0 pajodex Posted January 11, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Author Share Posted January 11, 2018 I'm getting this error in console every time I use command @die with the leader in the party [Error]: buildin_rid2name: invalid RID Quote Link to comment Share on other sites More sharing options...
0 Sehrentos Posted January 11, 2018 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 91 Reputation: 22 Joined: 10/24/14 Last Seen: November 1, 2024 Share Posted January 11, 2018 5 hours ago, pajodex said: I'm getting this error in console every time I use command @die with the leader in the party [Error]: buildin_rid2name: invalid RID Hey, Have you tried to add in some checks like, if some member is offline? I think when getting RID when some one is offline will fail. Not 100% sure about this! xD Like this: // (Optional) Check who is the killer if (killedrid == killerrid) { // You have been killed by your own hand end; } // Check player is in a party if (getcharid(1)) { getpartymember(getcharid(1), 2); set .@partymembercount, $@partymembercount; copyarray .@partymemberaid[0], $@partymemberaid[0], .@partymembercount; for (set .@i, 0; .@i < .@partymembercount; set .@i, .@i + 1) { // Try to attach each party member to this script if (attachrid(.@partymemberaid[.@i])) { // Now we can check player status like AFK if (checkvending() && checkchatting()) { // This member is AFK end; } } } } Quote Link to comment Share on other sites More sharing options...
Question
pajodex
Hi,
Is is possible to attach a OnPCKillEvent/OnPCDieEvent to the leader of party?
Thanks!
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.