Jump to content
  • 0

Need atcommand help, please!


Vainglorious

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Hello there,

 

since I have tried for days and still won't come up with any solution so far, I wanted to ask if anybody would be willing to help me...

 

I am trying to implement a @buff Command on my Server, but I always get an error when compiling. My src would be this:

 

 

ACMD_FUNC(buff)
{
    int zeny = 10000;
    nullpo_retr(-1, sd);
    
    if(sd->status.zeny < zeny)
    {
        clif_displaymessage(fd, "Sorry, but you do not have enough Zeny to use @buff. @buff cost = 10k Zeny.");
        return -1;
    }

    if ((map[sd->bl.m].flag.gvg) || (map[sd->bl.m].flag.pvp))
    {
        clif_displaymessage(fd, "Sorry, but you can't use @buff on PvP or GvG Maps.");
        return -1;
    }

    sd->status.zeny = sd->status.zeny-zeny;
    clif_updatestatus(sd, SP_ZENY);
    sc_start(&sd->bl,SC_INCREASEAGI,100,10,600000);
    sc_start(&sd->bl,SC_ANGELUS,100,10,600000);
    sc_start(&sd->bl,SC_BLESSING,100,10,600000);
    clif_displaymessage(fd, "You've received Buffs for 10 Minutes, have fun with it!");

    return 0;
}
 
 

 

 

 

And yes I have added the

 

 

 

ACMD_DEF(buff)

 

 

 

 

 

The Compiling Error is as follows:


 

 

1>c:\users\roadmin\desktop\ro server\trunk\src\map\atcommand.c(9060): error C2065: 'atcommand_buff': undeclared identifier
1>c:\users\roadmin\desktop\ro server\trunk\src\map\atcommand.c(9060): warning C4047: 'initialization': Number of indirection in 'AtCommandFunc' and 'int' varying

 

 

 

 


(i am using a german visual studio so i translated it as good as possible, sorry for that.)

So if anyone could help me I would be really greatful! :C

Thank You very much,

 

Vainglorious

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

wah nice commands. can it used for vip ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

weird i used your code in my server and it compiled fine

I added the ACMD_DEF after mount2 in my case like below

 

 
        ACMD_DEF(cart),
        ACMD_DEF(mount2),
        ACMD_DEF(buff)
    };
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Yeah i did the same but still the same error... :/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

can you post the code around the area where you added your ACMD_DEF

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Sure thing Mate!

 

 

Before the ACMD_DEF:

 

 

/**
 * Fills the reference of available commands in atcommand DBMap
 **/
#define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL }
#define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, NULL, NULL }
void atcommand_basecommands(void) {
 

 





Below the ACMD_DEF:
 

 

AtCommandInfo* atcommand;
    int i;

    for( i = 0; i < ARRAYLENGTH(atcommand_base); i++ ) {
        if(atcommand_exists(atcommand_base[i].command)) { // Should not happen if atcommand_base[] array is OK
            ShowDebug("atcommand_basecommands: duplicate ACMD_DEF for '%s'.\n", atcommand_base[i].command);
            continue;
        }
        CREATE(atcommand, AtCommandInfo, 1);
        safestrncpy(atcommand->command, atcommand_base[i].command, sizeof(atcommand->command));
        atcommand->func = atcommand_base[i].func;
        strdb_put(atcommand_db, atcommand->command, atcommand);
    }
    return;
}


 
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

lol i meant the statements around ACMD_DEF(buff) line you added.

basically the error you have shown specifies there is some issue with the line number 9060 so either that line or adjacent statement has some issue.

it would be best if you could paste lines 9058-9062 

 

BTW you forgot to add the skill effects in your atcommand. I got the buffs when i used the command but no effects

Edited by MStream
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Oh sorry, I missread that ... Haha My bad.
Well It's just this part:

9050 - 9062

 

 

        ACMD_DEF(reloadquestdb),
        ACMD_DEF(undisguiseguild),
        ACMD_DEF(disguiseguild),
        ACMD_DEF(sizeall),
        ACMD_DEF(sizeguild),
        ACMD_DEF(addperm),
        ACMD_DEF2("rmvperm", addperm),
        ACMD_DEF(unloadnpcfile),
        ACMD_DEF(cart),
        ACMD_DEF(mount2),
        ACMD_DEF(buff)

    };
 

 

And yes i know about the effect, wanted it to work first though!

Edited by Vainglorious
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

hmm ok so i think the issue is where you put the ACMD_FUNC(buff)

make sure it is not inside another function or ACMD_FUNC definition

 

in my case i put it after ending brace of ACMD_FUNC(cart) { 

since it is the last atcommand function defined :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

can u all share ? :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Yeah i had it pasted in a wrong section, it is working now! Thank you very much for your help!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

Yeah i had it pasted in a wrong section, it is working now! Thank you very much for your help!

 

please share full patch :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

I think you can use bindatcmd for this, it would be easier

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

I think you can use bindatcmd for this, it would be easier

 

please share a full script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

I think you can use bindatcmd for this, it would be easier

 

please share a full script.

 

Here try it

 

-	script	at_buff	-1,{
OnInit:
bindatcmd("@buff","at_buff::OnBuff");
end;
OnBuff:
if (zeny >= 1000)
{
set zeny,zeny-1000;
skilleffect 34,0; sc_start SC_BLESSING,600000,10;
skilleffect 29,0; sc_start SC_INCREASEAGI,600000,10;
dispbottom "[Buffer] Your are Buffed!!!";
close;
}
else
{
dispbottome "[Buffer] Sorry you dont have enough Zeny!";
}
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...