Hi I have this script taken from the script request section and my problem is that..
• I don't know how to check the @consecutive hours if it is divisible by 6..
What I want is that.. the server will check @consecutive hours by 6.. if @consecutive hours is divisible by 6 then, no +10 Cash Points will be added. BUT..
For 6 hours of playing = 100 CP
12 hours of playing = 200 CP
18 hours of playing = 300 CP
Now what I've done is a temporary remedy but the problem is even it is @6, or @12, or @18 it still give + 10 CP.
What to do? Thanks!
- script hourlypoints -1,{
//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1 || checkchatting() == 1) {
dispbottom "The hourly points event stopped because you were vending / chatting. Please relog if you wish to start again.";
stopnpctimer;
end;
}
//Check if Idle
getmapxy( .@map$, .@x, .@y, 0 );
if(@map$ == .@map$ && @x == .@x && @y == .@y) {
set @afk, @afk + 1;
}
//If move timer resets
else {
set @afk, 0;
}
set @map$, .@map$; set @x, .@x; set @y, .@y;
//Idle Check for 5 Minutes
if(@afk == 10) {
dispbottom "The hourly points event stopped because you were idle for 5 minutes. Please relog if you wish to start again.";
stopnpctimer;
end;
}
end;
OnTimer100:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
set @minute,0;
set @consecutive_hour, @consecutive_hour + 1;
if(@consecutive_hour != 24) {
message strcharinfo(0),"You have received 10 Cash Points for playing 1 hour!";
set #CASHPOINTS,#CASHPOINTS + 10;
dispbottom "Current Balance: "+#CASHPOINTS+"";
}
}
//Check for every 6 hours..
if(@consecutive_hour == 6 && @consec6 != 1) {
getitem 30090,1;
set #CASHPOINTS,#CASHPOINTS + 100;
announce ""+strcharinfo(0)+" has been awarded with 1 Rainbow Lucky Scroll + additional 100 Cash Points for staying ingame for 6 hours!",0;
dispbottom "Current Balance: "+#CASHPOINTS+"";
set @consec6, @consec6 +1;
}
//Check for every 12 hours..
if(@consecutive_hour == 12 && @consec12 != 1) {
getitem 30090,1;
set #CASHPOINTS,#CASHPOINTS + 200;
announce ""+strcharinfo(0)+" has been awarded with 1 Rainbow Lucky Scroll + addtional 200 Cash Points for staying ingame for 12 hours!",0;
dispbottom "Current Balance: "+#CASHPOINTS+"";
set @consec12, @consec12 +1;
}
//Check for every 18 hours
if(@consecutive_hour == 18 && @consec18 != 1) {
getitem 30090,1;
set #CASHPOINTS,#CASHPOINTS + 300;
announce ""+strcharinfo(0)+" has been awarded with 1 Rainbow Lucky Scroll + additional 300 Cash Points for staying ingame for 18 hours!",0;
dispbottom "Current Balance: "+#CASHPOINTS+"";
set @consec18, @consec18 +1;
}
//Check for 24 hours consecutive
if(@consecutive_hour == 24) {
set @consecutive_hour,0;
getitem 7227,12;
getitem 30090,1;
set #CASHPOINTS,#CASHPOINTS + 500;
announce ""+strcharinfo(0)+" has been awarded with 12 "+getitemname( 7227 )+" + 1 Rainbow Lucky Scroll + 500 Cash Points for staying ingame for 24 hours!",0;
dispbottom "Current Balance: "+#CASHPOINTS+"";
}
stopnpctimer;
initnpctimer;
end;
}
Edited by Emistry Please use [CODEBOX] or Attachments for long contents.
Question
Meister
Hi I have this script taken from the script request section and my problem is that..
• I don't know how to check the @consecutive hours if it is divisible by 6..
What I want is that.. the server will check @consecutive hours by 6.. if @consecutive hours is divisible by 6 then, no +10 Cash Points will be added. BUT..
For 6 hours of playing = 100 CP
12 hours of playing = 200 CP
18 hours of playing = 300 CP
Now what I've done is a temporary remedy but the problem is even it is @6, or @12, or @18 it still give + 10 CP.
What to do? Thanks!
Edited by EmistryPlease use [CODEBOX] or Attachments for long contents.
Link to comment
Share on other sites
3 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.