@Patskie Thanks
I now have the problem that you can make @autoloot 0.5 etc. and have less than 1% drop chance, how can I change this?
I tried to set rate = 0 to 100, but then I don't get autoloot turned off because I can't set autoloot 0 or off.
ACMD_FUNC(autoloot)
{
int rate;
nullpo_retr(-1, sd);
// autoloot command without value
if(!message || !*message)
{
if (sd->state.autoloot)
rate = 0;
else
rate = 10000;
} else {
double drate;
drate = atof(message);
rate = (int)(drate*100);
}
if (rate < 0) rate = 0;
if (rate > 10000) rate = 10000;
sd->state.autoloot = rate;
if (sd->state.autoloot) {
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below.
clif_displaymessage(fd, atcmd_output);
}else
clif_displaymessage(fd, msg_txt(sd,1188)); // Autoloot is now off.
return 0;
}