Auto Reward 1 per IP only

balanar12321

New member
Messages
6
Points
0
Emulator
rAthena
if( query_sql( "SELECT `account_id` FROM `char` WHERE `guild_id`='"+$koegid+"' AND `online`= 1 ",.@AID ) )
for( set .@i,0; .@i < getarraysize( .@AID ); set .@i,.@i + 1 ){
 getitem 601,1,.@AID[.@i];

getitem 602,1,.@AID[.@i];
 
}
end;

Can anyone help me to make this Auto Reward only 1 Per IP, if 2 players using 1 IP,,, only 1 player receive the prize at the end of the event

 
https://annieruru.blogspot.com/2019/01/how-to-compare-value-within-array.html

use 4th method since you are rathena user

prontera,150,190,5 script kjsfhkdhf 1_F_MARIA,{
if (inarray(.deny_ip$, getcharip()) >= 0) {
mes "You've claim reward with this IP";
close;
}
.deny_ip$[getarraysize(.deny_ip$)] = getcharip();
getitem 501,1;
end;
}




oh, wait, I thought you want modify reward given from koe script

now you want it to give everyone upon the event ends

Code:
-	script	sdfsdf	FAKE_NPC,{
Onaaa:
	.@guild_id = .@atcmd_parameters$; // <-- change this to your guild ID, whatever it came from

	getguildmember .@guild_id, 1;
	getguildmember .@guild_id, 2;
	for (.@i = 0; .@i < $@guildmembercount; ++.@i) {
		if (isloggedin($@guildmemberaid[.@i], $@guildmembercid[.@i])) {
			if (inarray(.@deny_ip$, getcharip($@guildmemberaid[.@i])) >= 0) {
				message rid2name($@guildmemberaid[.@i]), "Multiple IP detected.";
				continue;
			}
			.@deny_ip$[getarraysize(.@deny_ip$)] = getcharip($@guildmemberaid[.@i]);
			getitem 501, 1, $@guildmemberaid;
		}
	}
	end;
OnInit:
	bindatcmd "give", strnpcinfo(3)+"::Onaaa";
	end;
}
 
Back
Top