Rage Guy Posted May 4, 2013 Posted May 4, 2013 how to add @afk command . Thanks for who is going to help me Quote
0 skymia Posted June 22, 2017 Posted June 22, 2017 On 26/11/2013 at 11:33 PM, chatterboy said: All from above has error occur: Better use this guys! I made it haha... Compatible upto Rathena 17695 how to remove the message that he is in autotrade mode? i want is he can still receive the message even he is in afk mode Quote
Jaburak Posted May 4, 2013 Posted May 4, 2013 File Location: trunk/src/map/atcommand.c Find: ACMD_FUNC(reloadmsgconf) { map_msg_reload(); clif_displaymessage(fd, msg_txt(sd,463)); // Message configuration has been reloaded. return 0; } Add below: ACMD_FUNC(afk) { nullpo_retr(-1, sd); trade_tradeack(sd,4); sd->state.autotrade = 1; if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } clif_authfail_fd(fd, 15); return 0; } Find: AtCommandInfo atcommand_base[] = { Add below: ACMD_DEF(afk), Quote
Rage Guy Posted May 4, 2013 Author Posted May 4, 2013 Can u pls make it to me cuz i may break my scipts == Quote
iubantot Posted May 4, 2013 Posted May 4, 2013 File Location: trunk/src/map/atcommand.c Find: ACMD_FUNC(reloadmsgconf) { map_msg_reload(); clif_displaymessage(fd, msg_txt(sd,463)); // Message configuration has been reloaded. return 0; } Add below: ACMD_FUNC(afk) { nullpo_retr(-1, sd); trade_tradeack(sd,4); sd->state.autotrade = 1; if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } clif_authfail_fd(fd, 15); return 0; } Find: AtCommandInfo atcommand_base[] = { Add below: ACMD_DEF(afk), this error comes when i did this this happens while compiling . atcommand.c: In function âatcommand_afkâ: atcommand.c:8998: warning: passing argument 2 of âstatus_change_startâ makes pointer from integer without a cast atcommand.c:8998: error: too few arguments to function âstatus_change_startâ make[1]: *** [obj_sql/atcommand.o] Error 1 make[1]: Leaving directory `/eathena/src/map' Quote
Jaburak Posted May 4, 2013 Posted May 4, 2013 this error comes when i did this this happens while compiling . atcommand.c: In function âatcommand_afkâ: atcommand.c:8998: warning: passing argument 2 of âstatus_change_startâ makes pointer from integer without a cast atcommand.c:8998: error: too few arguments to function âstatus_change_startâ make[1]: *** [obj_sql/atcommand.o] Error 1 make[1]: Leaving directory `/eathena/src/map' Seems like you're using eAthena SVN. Quote
Rage Guy Posted May 4, 2013 Author Posted May 4, 2013 · Hidden by Patskie, November 26, 2013 - No essence with the topic Hidden by Patskie, November 26, 2013 - No essence with the topic o.O
iubantot Posted May 4, 2013 Posted May 4, 2013 (edited) this error comes when i did this this happens while compiling . atcommand.c: In function âatcommand_afkâ: atcommand.c:8998: warning: passing argument 2 of âstatus_change_startâ makes pointer from integer without a cast atcommand.c:8998: error: too few arguments to function âstatus_change_startâ make[1]: *** [obj_sql/atcommand.o] Error 1 make[1]: Leaving directory `/eathena/src/map' Seems like you're using eAthena SVN. im using rAthena Edited May 4, 2013 by ivantuting Quote
Jaburak Posted May 4, 2013 Posted May 4, 2013 im using rAthena Try this one; ACMD_FUNC(afk) { nullpo_retr(-1, sd); if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag ) { if (!message || !*message) { chat_createpcchat(sd, "(AFK)", "", 1, 1); trade_tradeack(sd,4); sd->state.autotrade = 1; if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } clif_authfail_fd(fd, 15); } if((strlen(message) < 0)||(strlen(message) > 36)) { chat_createpcchat(sd, "(@afk) mail me~", "", 1, 1); trade_tradeack(sd,4); sd->state.autotrade = 1; if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } clif_authfail_fd(fd, 15); } chat_createpcchat(sd, message, "", 1, 1); trade_tradeack(sd,4); sd->state.autotrade = 1; if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } clif_authfail_fd(fd, 15); } else clif_displaymessage(fd, "AFK is not allowed on this map."); return 0; } Quote
chatterboy Posted November 26, 2013 Posted November 26, 2013 (edited) All from above has error occur: 1>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): warning C4047: 'function' : 'block_list *' differs in levels of indirection from 'int'1>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): warning C4024: 'status_change_start' : different types for formal and actual parameter 21>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): error C2198: 'status_change_start' : too few arguments for call1>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): warning C4047: 'function' : 'block_list *' differs in levels of indirection from 'int'1>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): warning C4024: 'status_change_start' : different types for formal and actual parameter 21>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): error C2198: 'status_change_start' : too few arguments for call1>c:\besprenro server\rathena-160\src\map\atcommand.c(3754): warning C4047: 'function' : 'block_list *' differs in levels of indirection from 'int'1>c:\besprenro server\rathena-160\src\map\atcommand.c(3754): warning C4024: 'status_change_start' : different types for formal and actual parameter 21>c:\besprenro server\rathena-160\src\map\atcommand.c(3754): error C2198: 'status_change_start' : too few arguments for call Better use this guys! I made it haha... Compatible upto Rathena 17695 /*========================================== * @afk by GM Chatterboy [besprenRO Script] * Turns on/off Autotrade for a specific player *------------------------------------------*/ACMD_FUNC(afk) { nullpo_retr(-1, sd); if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) { clif_displaymessage(fd, msg_txt(sd,1179)); // Autotrade is not allowed on this map. return -1; } if( pc_isdead(sd) ) { clif_displaymessage(fd, msg_txt(sd,1180)); // You cannot autotrade when dead. return -1; } sd->state.autotrade = 1; if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } channel_pcquit(sd,0xF); //leave all chan clif_authfail_fd(sd->fd, 15); return 0;} Edited November 26, 2013 by chatterboy Quote
Question
Rage Guy
how to add @afk command .
Thanks for who is going to help me
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.