pajodex Posted January 11, 2018 Posted January 11, 2018 Hi, Is is possible to attach a OnPCKillEvent/OnPCDieEvent to the leader of party? Thanks! Quote
1 crazyarashi Posted January 11, 2018 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
0 pajodex Posted January 11, 2018 Author Posted January 11, 2018 Cool, Will try this soon. What if there are two parties? Quote
0 crazyarashi Posted January 11, 2018 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
0 pajodex Posted January 11, 2018 Author 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
0 Sehrentos Posted January 11, 2018 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
Question
pajodex
Hi,
Is is possible to attach a OnPCKillEvent/OnPCDieEvent to the leader of party?
Thanks!
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.