Jump to content
  • 0

Question

Posted
-	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.

2 answers to this question

Recommended Posts

  • 0
Posted
-	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;
}

 

  • 0
Posted
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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...