kyleanthonydizon Posted May 7, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 100 Reputation: 0 Joined: 10/22/16 Last Seen: May 17, 2017 Share Posted May 7, 2017 - script PvPPoints -1,{ OnInit: set .Delay,180; setarray $PVPMAPS1$[0],"guild_vs2","guild_vs3"; //you can add more maps here end; OnPCKillEvent: if (getcharid(0)) for(set .@i,0; .@i < getarraysize($PVPMAPS1$); set .@i,.@i+1) { if(strcharinfo(3) == $PVPMAPS1$[.@i]) { if( @Delay < gettimetick(2) ){ set .@Amount,1; set #PVPPOINTS,#PVPPOINTS + .@Amount; dispbottom "Gained "+.@Amount+" Cash Point. Total = "+#PVPPOINTS+" PvP Points."; if( .Delay ) set @Delay,gettimetick(2) + .Delay; } } } end; OnPCDieEvent: if(strcharinfo(3) == $PVPMAPS1$[.@i]) { if(strcharinfo(3) == $PVPMAPS1$[.@i]) { set .@Amount,1; set #PVPPOINTS,#PVPPOINTS - .@Amount; dispbottom "Lost "+.@Amount+" Cash Point. Total = "+#PVPPOINTS+" Cash Points."; end; } } How will I catch like, If PVPPoints <= 0 it will not minus 1 points. Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted May 7, 2017 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted May 7, 2017 - script PvPPoints -1,{ OnInit: .Delay = 180; setarray $PVPMAPS1$[0],"guild_vs2","guild_vs3"; //you can add more maps here end; OnPCKillEvent: if (getcharid(0)) for(set .@i,0; .@i < getarraysize($PVPMAPS1$); set .@i,.@i+1) { if(strcharinfo(3) == $PVPMAPS1$[.@i]) { if( @Delay < gettimetick(2) ){ .@Amount = 1; #PVPPOINTS += .@Amount; dispbottom "Gained "+.@Amount+" Cash Point. Total = "+#PVPPOINTS+" PvP Points."; if( .Delay ){ @Delay = gettimetick(2) + .Delay; } } } } end; OnPCDieEvent: if(strcharinfo(3) == $PVPMAPS1$[.@i]) { if(strcharinfo(3) == $PVPMAPS1$[.@i]) { .@Amount = 1; if(#PVPPOINTS >= .@Amount) { #PVPPOINTS -= .@Amount; dispbottom "Lost "+.@Amount+" Cash Point. Total = "+#PVPPOINTS+" Cash Points."; } else { //dispbottom "Attempting to subtract more points than the player owns."; // You could optionally just reset to 0 here too //#PVPPOINTS = 0; } end; } } end; } Quote Link to comment Share on other sites More sharing options...
0 kyleanthonydizon Posted May 10, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 100 Reputation: 0 Joined: 10/22/16 Last Seen: May 17, 2017 Author Share Posted May 10, 2017 On 5/7/2017 at 10:15 AM, Akkarin said: - script PvPPoints -1,{ OnInit: .Delay = 180; setarray $PVPMAPS1$[0],"guild_vs2","guild_vs3"; //you can add more maps here end; OnPCKillEvent: if (getcharid(0)) for(set .@i,0; .@i < getarraysize($PVPMAPS1$); set .@i,.@i+1) { if(strcharinfo(3) == $PVPMAPS1$[.@i]) { if( @Delay < gettimetick(2) ){ .@Amount = 1; #PVPPOINTS += .@Amount; dispbottom "Gained "+.@Amount+" Cash Point. Total = "+#PVPPOINTS+" PvP Points."; if( .Delay ){ @Delay = gettimetick(2) + .Delay; } } } } end; OnPCDieEvent: if(strcharinfo(3) == $PVPMAPS1$[.@i]) { if(strcharinfo(3) == $PVPMAPS1$[.@i]) { .@Amount = 1; if(#PVPPOINTS >= .@Amount) { #PVPPOINTS -= .@Amount; dispbottom "Lost "+.@Amount+" Cash Point. Total = "+#PVPPOINTS+" Cash Points."; } else { //dispbottom "Attempting to subtract more points than the player owns."; // You could optionally just reset to 0 here too //#PVPPOINTS = 0; } end; } } end; } Thank you, will give this a try Quote Link to comment Share on other sites More sharing options...
Question
kyleanthonydizon
How will I catch like, If PVPPoints <= 0 it will not minus 1 points.
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.