Jump to content
  • 0

Siege Points


cahadeyelo

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

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;
	}
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

i replaced the || code to && and it works sir thanks...:lol:

Link to comment
Share on other sites

  • 1

  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

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.

Link to comment
Share on other sites

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.

×
×
  • Create New...