Jump to content

Question

Posted

i wanna ask if this is normal. any job on my server can use @autotrade/@at command. if im not wrong i know that only genetic and mechanic or whoever has a cart can use @autotrade?

 

i want to disable @autotrade to all job except for those who has a cart like genetic and mechanic.

 

Thanks rA

6 answers to this question

Recommended Posts

Posted

Edit your groups.conf, deny the use of autotrade for gmlevel 0, then create a new script with bindatcmd.

-	script	denyautotrade	-1,{
OnInit:
    bindatcmd("trade","denyautotrade::OnActivate");
	setarray .allow[0],4058,4064,4071,4078,4086,4087,4100,4107,4112;
    end;
OnActivate:
	for( set .@i, 0; .@i < getarraysize(.allow); set .@i, .@i +1 ) {
		if(class != .allow[.@i]) {
			dispbottom "Autotrade function is available only for Mechanics and Genetics.";
			end;
		}
	}
    atcommand "@autotrade";
    end;
}


The current command is @trade, but you can change it to anything you want.

  • Upvote 1
Posted

Normally whoever has cart can use @at, maybe you have a custom mod which does this or you have a custom script which gives your player a cart.

 

 

i put @autotrade on normal players. is that why they can use in whatever job? or should i put @at only so that only mechanic and genetic can use only autotrade command?

Posted

Edit your groups.conf, deny the use of autotrade for gmlevel 0, then create a new script with bindatcmd.

-	script	denyautotrade	-1,{
OnInit:
    bindatcmd("trade","denyautotrade::OnActivate");
	setarray .allow[0],4058,4064,4071,4078,4086,4087,4100,4107,4112;
    end;
OnActivate:
	for( set .@i, 0; .@i < getarraysize(.allow); set .@i, .@i +1 ) {
		if(class != .allow[.@i]) {
			dispbottom "Autotrade function is available only for Mechanics and Genetics.";
			end;
		}
	}
    atcommand "@autotrade";
    end;
}

The current command is @trade, but you can change it to anything you want.

 

thank you

  • Like 1
Posted

The Source Code is 

ACMD_FUNC(autotrade)
{
    nullpo_retr(-1, sd);
 
    if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {  //THIS MEANS AUTOTRADE NOT ALLOWED IN MAP SPECIFIED BY MAPFLAG
        clif_displaymessage(fd, msg_txt(1179)); // Autotrade is not allowed on this map.
        return -1;
    }
 
    if( pc_isdead(sd) ) {
        clif_displaymessage(fd, msg_txt(1180)); // You cannot autotrade when dead.
        return -1;
    }
 
    if( !sd->state.vending && !sd->state.buyingstore ) { //THIS CHECKS WHETHER THEY ARE VENDING OR IN BUYINGSTORE, IF THEY ARE VENDING/BUYINGSTORE THEN THEY CAN USE IT. MAYBE YOU EDITED SOMETHING HERE, OTHERWISE IT WOULD WORK FINE
        clif_displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
        return -1;
    }
 
    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;
}

 

Posted

If it doesn't work, try this one.

-	script	denyautotrade	-1,{
OnInit:
bindatcmd("trade","denyautotrade::OnActivate");
setarray .allow[0],4058,4064,4071,4078,4086,4087,4100,4107,4112;
end;

OnActivate:
for( set .@i, 0; .@i < getarraysize(.allow); set .@i, .@i +1 ) {
	if(class == .allow[.@i]) {
		atcommand "@autotrade";
		end;
	}
}
dispbottom "Autotrade function is available only for Mechanics and Genetics.";
end;
}

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