Jump to content
  • 0

Error in my coupon npc


Oraios

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

Hi community,

I become a error on the mapserver when starting the npc :

 

Line :         set @balance,query_sql("SELECT `balance` FROM `cp_credits` where `account_id` = "+ getcharid(3));

 

Error : getarg: no callfunc or callsub!

L_Start2:
        next;
        mes @npcname$;
        mes "Super, ich gebe dir dann "+ @coupons+" Donation Credit(s)!";
        set @balance,query_sql("SELECT `balance` FROM `cp_credits` where `account_id` = "+ getcharid(3));
        set @balance,@balance + @coupons;        
        query_sql("UPDATE `cp_credits` SET `balance` = "+@balance+" where `account_id` = "+ getcharid(3));
        delitem @couponid,@coupons;
        next;
        mes @npcname$;
        mes "Danke nochmal, weiterhin viel Spass auf Black-Knight-RO!";
        close;
Edited by Capuche
Change the title to a more informative one
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  59
  • Reputation:   4
  • Joined:  08/28/13
  • Last Seen:  

Label " L_Start2: " is not a function.
try using callfunc and make it a function instead of callsub and label.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

hmm can you change it for me? :o I don't know how... :/

//===== eAthena Script ======================================= 
//= Coupon Lady NPC
//===== By: ================================================== 
//= Legacy
//===== Current Version: ===================================== 
//= 1
//===== Compatible With: ===================================== 
//= eAthena, rAthena
//====== Beschreibung : ====================================== 
//= Bei ihr kann man Donation Coupons gegen Donation Credits
//= eintauschen!
//============================================================


dewata,180,206,3    script    Coupon Lady    91,{


//|~~~~~~~~~~~~~ Settings des NPC: ~~~~~~~~~~~~~~~~~
    set @npcname$,"^999999[Coupon Lady]^000000";
    set @couponid,7037;
//|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    mes @npcname$;
    mes "Hallo "+strcharinfo(0)+"";
    mes "Ich bin auf der Suche nach Coupons.... hast du welche? Ich gebe dir fuer jeden Coupon 1 Donation Credit...";
    menu "Ja habe ich!",L_Start,"Nein, leider nicht",L_End;
        
    L_Start:
        next;
        mes @npcname$;
        mes "Wie viele Coupons moechtest du mir denn geben??";
        next;
        
    L_Inputing:
        input @coupons;        
        if (@coupons<= 0) {
            mes @npcname$;
            mes "Du hast keine Zahl eingegeben.";
            next;
            goto L_Inputing;
        } else if (countitem(getarg(0)) < @coupons) {
            mes @npcname$;
            mes "Leider hast du nicht genug Coupons. Bitte komm wieder, wenn du genug hast!";
            close;
        }
        next;
        mes @npcname$;
        mes "Du moechtest mir also "+ @coupons+" geben?";
        menu "Ja!",L_Start2,"Nein doch nicht",L_End;
        
        
    L_Start2:
        next;
        mes @npcname$;
        mes "Super, ich gebe dir dann "+ @coupons+" Donation Credit(s)!";
        set @balance,query_sql("SELECT `balance` FROM `cp_credits` where `account_id` = "+ getcharid(3));
        set @balance,@balance + @coupons;        
        query_sql("UPDATE `cp_credits` SET `balance` = "+@balance+" where `account_id` = "+ getcharid(3));
        delitem @couponid,@coupons;
        next;
        mes @npcname$;
        mes "Danke nochmal, weiterhin viel Spass auf Black-Knight-RO!";
        close;


    L_End:
        next;
        mes @npcname$;
        mes "Bitte komm wieder, wenn du Coupons hast!";
        close;
}
Edited by Patskie
Change to code
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  231
  • Reputation:   24
  • Joined:  12/18/11
  • Last Seen:  

you lacking of sql table in your database

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

replace

} else if (countitem(getarg(0)) < @coupons) {

by

} else if (countitem( @couponid ) < @coupons) {
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...