cahadeyelo Posted November 29, 2016 Group: Members Topic Count: 71 Topics Per Day: 0.02 Content Count: 174 Reputation: 1 Joined: 11/13/14 Last Seen: Friday at 02:52 AM Share Posted November 29, 2016 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; } } Quote Link to comment Share on other sites More sharing options...
0 cahadeyelo Posted November 29, 2016 Group: Members Topic Count: 71 Topics Per Day: 0.02 Content Count: 174 Reputation: 1 Joined: 11/13/14 Last Seen: Friday at 02:52 AM Author Share Posted November 29, 2016 i replaced the || code to && and it works sir thanks... Quote Link to comment Share on other sites More sharing options...
1 Haziel Posted November 29, 2016 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted November 29, 2016 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. Quote Link to comment Share on other sites More sharing options...
Question
cahadeyelo
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.