Jump to content
  • 0

Question

Posted

why my script keeps adding up points even there's no war in progress?

 

-	script	Siege Points	-1,{

OnPCLoginEvent:
	attachnpctimer ""+strcharinfo(0)+"";
	initnpctimer;
	end;
	
OnTimer60001:
	if(checkvending() >= 1) {
	dispbottom "The Siege Point(s) stopped because you were vending. Please relog if you wish to start again.";
	stopnpctimer;
	end;
	}
	getmapxy( .@map$, .@x, .@y, 0 );
	if(@map$ == .@map$ && @x == .@x && @y == .@y) {
	set @afk, @afk + 1;
	}
	else {
	set @afk, 0;
	}
	set @map$, .@map$; set @x, .@x; set @y, .@y;
	if(@afk == 5) {
	dispbottom "The Siege Point(s) stopped because you were idle for 5 minutes. Please relog if you wish to start again.";
	stopnpctimer;
	end;
	}

OnTimer60002:
	getmapxy( .@woe$, .@x, .@y, 0 );
	if( agitcheck() || .@woe$ == "prtg_cas01" ) {
	set SIEGEPOINTS,SIEGEPOINTS + 1;
	dispbottom "Gained : 1 Point(s). Total : "+ SIEGEPOINTS +" Siege Point(s).";
	}
	if( !agitcheck() || .@woe$ == "prtg_cas01" ) {
	stopnpctimer;
	end;
	}
	getmapxy( .@map$, .@x, .@y, 0 );
	if(.@map$ == "sec_pri") {
	dispbottom "The Siege Point(s) was disabled in Jail.";
	stopnpctimer;
	end;
	}
	if(@map$ == .@map$ && @x == .@x && @y == .@y) {
	set @afk, @afk + 1;
	stopnpctimer;
	initnpctimer;
	end;
	}
}

 

2 answers to this question

Recommended Posts

  • 1
Posted
if( agitcheck() || .@woe$ == "prtg_cas01" ) {

What you're checking here is read is:

IF war is happening OR the player is on "prtg_cas01", give points.
| | symbol represents OR, so, IF would work if one of the following conditions is met.

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