cahadeyelo Posted November 29, 2016 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
0 cahadeyelo Posted November 29, 2016 Author Posted November 29, 2016 i replaced the || code to && and it works sir thanks... Quote
1 Haziel Posted November 29, 2016 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
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; } }
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.