Jump to content
  • 0

Hourly reward item script help


Question

Posted

can you please help me for my problem

 

why does this script not working properly /.... when i restart the server the hourly item reward is not working again

 

even i recompile the server many times

 

but before its working how does this happen

 

BTW this is the script 

-	script	hourlypoints	-1,{
 
//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
   
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1) {
    dispbottom "The hourly badge rewards has stopped because you were vending . Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
 
OnTimer60000:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
    set @minute,0;
    getitem 7859,1;
    dispbottom "You received 1 "+getitemname( 7859 )+" by staying ingame for 1 hour.";
    set @consecutive_hour, @consecutive_hour + 1;
    }
//Check for 12 hours consecutive
    if(@consecutive_hour == 5) {
    set @consecutive_hour,0;
    getitem 7859,5;
    dispbottom "You received 5 "+getitemname( 7859 )+" by staying ingame for consecutive of 5 hours.";
    }
stopnpctimer;
initnpctimer;
end;
 
}

 thank you more power

12 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, Questune09 said:

can you please help me for my problem

 

why does this script not working properly /.... when i restart the server the hourly item reward is not working again

 

even i recompile the server many times

 

but before its working how does this happen

 

BTW this is the script 


-	script	hourlypoints	-1,{
 
//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
   
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1) {
    dispbottom "The hourly badge rewards has stopped because you were vending . Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
 
OnTimer60000:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
    set @minute,0;
    getitem 7859,1;
    dispbottom "You received 1 "+getitemname( 7859 )+" by staying ingame for 1 hour.";
    set @consecutive_hour, @consecutive_hour + 1;
    }
//Check for 12 hours consecutive
    if(@consecutive_hour == 5) {
    set @consecutive_hour,0;
    getitem 7859,5;
    dispbottom "You received 5 "+getitemname( 7859 )+" by staying ingame for consecutive of 5 hours.";
    }
stopnpctimer;
initnpctimer;
end;
 
}

 thank you more power

can you give me some error code in the console ? maybe i can help you

  • 0
Posted
15 hours ago, srhmike said:

You dont need to recompile when adding a npc script.

Did you wait the hour to see if it gives you the item?

they wait for almost 5 hours but nothing happen 

 

but before its working

  • 0
Posted (edited)
1 hour ago, Questune09 said:

when i restart the server the hourly item reward is not working again

in trunk/src/map/map.h

#define MAX_EVENTQUEUE 2

increase the value  and recompile 

Edited by Cyro
  • Upvote 1
  • 0
Posted
15 hours ago, Cyro said:

when server restart player time is not resume! thats what you saying its not working properly ?

i just wondering we almost wait for about  5 hours but nothing recieved item

  • 0
Posted
29 minutes ago, hanxian123 said:

hey guys...how to set if player afk or stay at one place more than 1 minute cant get count the hour reward ?

try this

-	script	hourlypoints	-1,{
 
//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
   
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1) {
    dispbottom "The hourly badge rewards has stopped because you were vending . 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;

OnTimer60000:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
    set @minute,0;
    getitem 7859,1;
    dispbottom "You received 1 "+getitemname( 7859 )+" by staying ingame for 1 hour.";
    set @consecutive_hour, @consecutive_hour + 1;
    }
//Check for 12 hours consecutive
    if(@consecutive_hour == 5) {
    set @consecutive_hour,0;
    getitem 7859,5;
    dispbottom "You received 5 "+getitemname( 7859 )+" by staying ingame for consecutive of 5 hours.";
    }
stopnpctimer;
initnpctimer;
end;
 
}

 

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