Jump to content

Question

10 answers to this question

Recommended Posts

Posted

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),
Posted

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'
 
Posted

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.

Posted · Hidden by Patskie, November 26, 2013 - No essence with the topic
Hidden by Patskie, November 26, 2013 - No essence with the topic

o.O

Posted (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 by ivantuting
Posted

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;
}
Posted (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 2
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): error C2198: 'status_change_start' : too few arguments for call
1>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 2
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): error C2198: 'status_change_start' : too few arguments for call
1>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 2
1>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 by chatterboy
  • 0
Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...