quesoph Posted January 31, 2012 Posted January 31, 2012 Hi, I am having a little trouble about the script i am trying to make. what im trying to do is: if player 1 killed player 2, and player 2 doesn't have any cash points then player 1 will not gain cash points. if player 1 killed player 2 with cash points then player 1 will gain cash points. here is the script: OnPCKillEvent: for (set .@a, 0; .@a < getarraysize(.maps$); set .@a, .@a + 1) { if ( strcharinfo(3) == .maps$ ) if ( #CASHPOINTS == 0) end; //<- not working. set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "you gained 1 cash point, Total is "+#CASHPOINTS+" Cash Points."; end; } Thank you! Quote
Emistry Posted January 31, 2012 Posted January 31, 2012 you need at attach the script to the player2 to check whether the victim of pvp got cashpoint or not.. in your current script , it only check for the killer's cashpoint...not killed person. try this..hope this work for you.. - script Sample -1,{ OnPCDieEvent: if( #CASHPOINTS ){ attachrid( getcharid( 3,rid2name(killerrid) ) ){ dispbottom "You gained 1 Cash Points."; set #CASHPOINTS,#CASHPOINTS + 1; } } end; } Quote
quesoph Posted January 31, 2012 Author Posted January 31, 2012 (edited) ^ Thank you for you reply. what i am trying to do is. if the player 2 character doesn't have cash points then the player 1 will not acquire cash points. is it possible that i could place a check on "OnPCKillEvent" about the player 2 cash points. if player 2's cash points is equals to zero then print "The player you've killed doesn't have enough cash points." end script. After reading so many threads i manage to figure it out. thank you for your help. please close thanks. Edited January 31, 2012 by quesoph Quote
Question
quesoph
Hi, I am having a little trouble about the script i am trying to make.
what im trying to do is:
if player 1 killed player 2, and player 2 doesn't have any cash points
then player 1 will not gain cash points.
if player 1 killed player 2 with cash points then player 1 will gain cash points.
here is the script:
Thank you!
2 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.