Jump to content
  • 0
Sign in to follow this  
balanar12321

Auto Reward 1 per IP only

Question

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

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

  • 0

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

-	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;
}

 

Share this post


Link to post
Share on other sites

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.