quesoph Posted January 31, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 210 Reputation: 10 Joined: 11/20/11 Last Seen: August 23, 2015 Share 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 Link to comment Share on other sites More sharing options...
Emistry Posted January 31, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: 2 hours ago Share 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 Link to comment Share on other sites More sharing options...
quesoph Posted January 31, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 210 Reputation: 10 Joined: 11/20/11 Last Seen: August 23, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
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!
Link to comment
Share on other sites
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.