Jump to content
  • 0

Hourly reward item script help


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

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

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   3
  • Joined:  10/11/13
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  261
  • Reputation:   53
  • Joined:  11/11/16
  • Last Seen:  

You dont need to recompile when adding a npc script.

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

the console said warning: npc_event: players event  queve is full cant add item hourly reward item

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

2 minutes ago, Cyro said:

in trunk/src/map/map.h


#define MAX_EVENTQUEUE 2

increase the value  and recompile 

try this

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

15 hours ago, Cyro said:

try this

already set to 2

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

Just now, Questune09 said:

already set to 2

as i said increase it from 2 to 10 or 20

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

15 hours ago, Cyro said:

as i said increase it from 2 to 10 or 20

ahahah ok sorry i dont understand it +1

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  04/12/18
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1191
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

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

 

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