Jump to content
  • 0

Giving Item To All Online Players


Question

Posted

Ive been using this script to give all online players except vendors gift , Btw, i need some modification so that dual client player will received for one client only. means that dual also should receive the same as single client for fair.

 

here is the script that im using right now :

// usage :
// [npc:Sample]map#512#10
// [npc:Sample]all#512#123


-	script	itemall	-1,{
OnWhisperGlobal:
if( getgroupid() >= 99 ){
	// check map
	if( @whispervar0$ == "all" ) set .@type$,"";
	else if( @whispervar0$ == "map" ) set .@type$,strcharinfo(3);
	else {
		dispbottom "Error, pick 'map' or 'all' ";
		end;
	}
	
	// check item
	set .@itemid,atoi( @whispervar1$ );
	set .@amount,atoi( @whispervar2$ );
	if( getitemname( .@itemid ) == "null" || .@amount < 1 ){
		dispbottom "Enter valid item id and amount.";
	}
	
	set .@self_id,getcharid(3);
	query_sql( "SELECT COUNT(`account_id`) FROM `char` WHERE `online` = 1 ", .@total );
	while( .@count < .@total ){
		query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY `account_id` LIMIT 128 OFFSET "+.@offset, .@aid,.@name$ );
		set .@i,0;
		set .@size,getarraysize( .@aid );
		while( .@i < .@size ){
			if( .@aid[.@i] != .@self_id && !checkvending(.@name$[.@i]) ){
				if( .@type$ != "" ){
					getmapxy( .@map$,.@x,.@y,0,.@name$[.@i] );
					if( .@map$ == .@type$ ){
						getitem .@itemid,.@amount,.@aid[.@i];
						set .@gave,.@gave + 1;
					}
				}else{
					getitem .@itemid,.@amount,.@aid[.@i];
					set .@gave,.@gave + 1;
				}
			}
			set .@count,.@count + 1;
			set .@i,.@i + 1;
		}
		set .@offset,.@offset + .@size;
		deletearray .@aid,.@size;
		deletearray .@name$,.@size;
	}
	dispbottom "Gave "+.@amount+" x "+getitemname( .@itemid )+" to "+.@gave+" Player(s).";
}
end;
}

I hope someone can help me since im really need to settle this issue earlier. Thanks /thx

5 answers to this question

Recommended Posts

Posted

Unless you know a way on how to detect if someone's using a dual client, come back here and tell me.

 

That's being said: it's not an easy thing to check if there are people dual client-ing or not.

 

You can check if a player is dual client-ing or not with the support of game guards (Harmony or other), which is beyond our range (further questions goes to the subject of which GG you're using).

 

The only way to detect a POSSIBLY (80%) is to check their IP:

https://rathena.org/board/topic/84477-dual-client-kick-at-same-map/page-2

 

using this one will do the following:

1. If the user is dual-ing, then it got it.

2. If there are some players (different people) in 1 network (A, B, C is using B's WiFi) then, only either A or B or C will get it. not all of them.


http://pastebin.com/raw.php?i=rj0pX26x

Posted

Unless you know a way on how to detect if someone's using a dual client, come back here and tell me.

 

That's being said: it's not an easy thing to check if there are people dual client-ing or not.

 

You can check if a player is dual client-ing or not with the support of game guards (Harmony or other), which is beyond our range (further questions goes to the subject of which GG you're using).

 

The only way to detect a POSSIBLY (80%) is to check their IP:

https://rathena.org/board/topic/84477-dual-client-kick-at-same-map/page-2

 

using this one will do the following:

1. If the user is dual-ing, then it got it.

2. If there are some players (different people) in 1 network (A, B, C is using B's WiFi) then, only either A or B or C will get it. not all of them.

http://pastebin.com/raw.php?i=rj0pX26x

 

yeah ive read all of that :/

ill try to think and implement maybe

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