Jump to content
  • 0

[Error]: npc_addsrcfile: Can't find source file


mansanalchamp

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  30
  • Reputation:   1
  • Joined:  04/20/20
  • Last Seen:  

Could you help me, please ?

I would like to make npc script for top-up in rAthena system.

When I run "runserver.bat" I find error > npc_addsrcfile: Can't find source file "npc/[path]" in map-server.bat and npc not work,

but when I run server eAthena I can run the script as usual and npc script can working.

So, I think it may be caused by npc.cpp file int path "/src/map/npc.cpp" but I am not sure.

Is there a way to help me fix this problem?

this is my npc script .

-	script	TMPAY	 -1,{

//--- Check Timer
OnPCLoginEvent:
query_sql "select SUM(amount) as sum_refill_amount from truemoney where account_id='"+getcharid(3)+"' and status='1'",.@sum_refill_amount;

if (.@sum_refill_amount>0) {
set #CASHPOINTS,(#CASHPOINTS + .@sum_refill_amount);
query_sql "update truemoney set status='2' where account_id='"+getcharid(3)+"' and status='1'";
dispbottom "you got CASH "+.@sum_refill_amount+" cash";
close;
}
end;

}


-	script	TMPAYMONEY	 111,{

//--- Check credit card every 10 second
OnTimer10000:
debugmes "asdf"; // <-- I added this line to see your timer is running or not
query_sql "select card_id,account_id,amount from truemoney where status='1' and amount>0",.card_id,.account_id,.amount;
sleep2 500;
if (getarraysize(.card_id) > 0) {
for (set .i,0; .i < getarraysize(.card_id); set .i,.i+1) { 
if(attachrid(.account_id[.i])==1) {      
     query_sql "select status from truemoney where card_id='"+.card_id[.i]+"'",.check_refill$;
     if(.check_refill$=="1") {
       dispbottom "You got cash " +.amount[.i]+" Cash";
       set #CASHPOINTS,(#CASHPOINTS + .amount[.i]);
       query_sql "update truemoney set status='2' where card_id='"+.card_id[.i]+"'";
      }
}
detachrid;
}
}
deletearray .card_id,getarraysize(.card_id); 
deletearray .account_id,getarraysize(.account_id);
deletearray .amount,getarraysize(.amount);

//--- Bonus credit
query_sql "select card_id,account_id,item_id,item_name,item_amount from cutrue_item_bonus where bonus_refill='1' and item_amount>0",.idb,.account_idb,.item_id,.item_name$,.item_amount;
sleep2 500;
if (getarraysize(.idb) > 0) {
for (set .j,0; .j < getarraysize(.idb); set .j,.j+1) { 
if(attachrid(.account_idb[.j])==1) {      
     query_sql "select bonus_refill from cutrue_item_bonus where card_id='"+.idb[.j]+"'",.check_refill$;      
     if(.check_refill$=="1") {
       dispbottom "You got bonus Item : "+.item_name$[.j]+"  "+.item_amount[.j]+" ea";
       getitem .item_id[.j],.item_amount[.j];
       query_sql "update cutrue_item_bonus set bonus_refill='2' where card_id='"+.idb[.j]+"'";
      }
}
detachrid;
}
}
deletearray .card_id,getarraysize(.idb); 
deletearray .account_id,getarraysize(.account_idb);
deletearray .item_id$,getarraysize(.item_id$);
deletearray .item_name$,getarraysize(.item_name$);
deletearray .item_amount,getarraysize(.item_amount);

initnpctimer;
end;

OnInit:
initnpctimer;
end;

}

this is a  result 

image.png.3521759a03a42dbb43a12dbfca092879.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

try removing the dot (.) on the folder name. It might be causing the emulator to read it as file extension therefore it halts at that part.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  30
  • Reputation:   1
  • Joined:  04/20/20
  • Last Seen:  

21 hours ago, Mabuhay said:

try removing the dot (.) on the folder name. It might be causing the emulator to read it as file extension therefore it halts at that part.

Thank you very much 

and then When I run server I can't found error but NPC script notworking 

Is there a way to help me fix this problem?

-	script	TMPAY	 -1,{

//--- Check Timer
OnPCLoginEvent:
query_sql "select SUM(amount) as sum_refill_amount from truemoney where account_id='"+getcharid(3)+"' and status='1'",.@sum_refill_amount;

if (.@sum_refill_amount>0) {
set #CASHPOINTS,(#CASHPOINTS + .@sum_refill_amount);
query_sql "update truemoney set status='2' where account_id='"+getcharid(3)+"' and status='1'";
dispbottom "you got CASH "+.@sum_refill_amount+" cash";
close;
}
end;

}


-	script	TMPAYMONEY	 111,{

//--- Check credit card every 10 second
OnTimer10000:
debugmes "asdf"; // <-- I added this line to see your timer is running or not
query_sql "select card_id,account_id,amount from truemoney where status='1' and amount>0",.card_id,.account_id,.amount;
sleep2 500;
if (getarraysize(.card_id) > 0) {
for (set .i,0; .i < getarraysize(.card_id); set .i,.i+1) { 
if(attachrid(.account_id[.i])==1) {      
     query_sql "select status from truemoney where card_id='"+.card_id[.i]+"'",.check_refill$;
     if(.check_refill$=="1") {
       dispbottom "You got cash " +.amount[.i]+" Cash";
       set #CASHPOINTS,(#CASHPOINTS + .amount[.i]);
       query_sql "update truemoney set status='2' where card_id='"+.card_id[.i]+"'";
      }
}
detachrid;
}
}
deletearray .card_id,getarraysize(.card_id); 
deletearray .account_id,getarraysize(.account_id);
deletearray .amount,getarraysize(.amount);

//--- Bonus credit
query_sql "select card_id,account_id,item_id,item_name,item_amount from cutrue_item_bonus where bonus_refill='1' and item_amount>0",.idb,.account_idb,.item_id,.item_name$,.item_amount;
sleep2 500;
if (getarraysize(.idb) > 0) {
for (set .j,0; .j < getarraysize(.idb); set .j,.j+1) { 
if(attachrid(.account_idb[.j])==1) {      
     query_sql "select bonus_refill from cutrue_item_bonus where card_id='"+.idb[.j]+"'",.check_refill$;      
     if(.check_refill$=="1") {
       dispbottom "You got bonus Item : "+.item_name$[.j]+"  "+.item_amount[.j]+" ea";
       getitem .item_id[.j],.item_amount[.j];
       query_sql "update cutrue_item_bonus set bonus_refill='2' where card_id='"+.idb[.j]+"'";
      }
}
detachrid;
}
}
deletearray .card_id,getarraysize(.idb); 
deletearray .account_id,getarraysize(.account_idb);
deletearray .item_id$,getarraysize(.item_id$);
deletearray .item_name$,getarraysize(.item_name$);
deletearray .item_amount,getarraysize(.item_amount);

initnpctimer;
end;

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