Jump to content
  • 0

Gives Item for All Script


GMxR

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   0
  • Joined:  02/13/12
  • Last Seen:  

halo rathena,

can someone please tell me the function of this script. and the procedure how? it suppose to give item for everyone in the map. 
 

-	script	fi	-1,{
OnWhisperGlobal:
	if(getgmlevel()<99)	end;
	if(@whispervar0$=="map")
		set .@map$,@whispervar3$==""?strcharinfo(3):@whispervar3$;
	else if(@whispervar0$=="all")
		set .@map$,"*";
	else
	{
		dispbottom "Error 1";
		end;
	}
	if(getiteminfo(set(.@id,atoi( @whispervar1$ )),0)<0)
	{
		dispbottom "Error 2";
		end;
	}
	set .@nam$,strcharinfo(0);
	set .@num,set(.@num,atoi( @whispervar2$))<1?1:.@num;
	set .@n,set(.@t,set(.@n,getusers(1))/128)<1?1:!.@n%128?.@t:.@t+1;
	for(set .@i,0;.@i<.@n;set .@i,.@i+1)
	{
		query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1 LIMIT "+(127*.@i)+","+(127*(.@i+1))+"",getd(".@OLU_"+.@i));
		for(set .@g,0;;set .@g,.@g+1)
		{
			if(isloggedin(set(.@v,getd(".@OLU_"+.@i+"["+.@g+"]"))))
			{
				getmapxy(.@map2$,.@x,.@y,0,rid2name(.@v));
				if(.@map$!="*"&&.@map$!=.@map2$)continue;
				message rid2name(.@v),""+.@nam$+" gives you "+.@num+" "+getitemname(.@id);
				getitem .@id,.@num,.@v;
			}
			if(!.@v)break;
		}
	}
	end;
}

credits to the maker of this script by the way. thanks. 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

A GM can whisper to NPC:fi. The first word is either "map" or "all". This will determine who receives the item. The second word is the item ID you wish to give. The third input is the quantity of the item. The fourth word is an optional map name. If "map" is specified without a specific map, then it will default to the map on which the GM is standing.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   0
  • Joined:  02/13/12
  • Last Seen:  

 

 

thank you.

could you please tell me the right procedure. i always get error 1 whenever i type 

map 607 1

OR 

map, 607, 1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   6
  • Joined:  12/11/12
  • Last Seen:  

if you want the map that the gm is in there like Admin is standing at prontera 

use  map#607#1 (Gives 1 yggdrasil berry to all players at prontera)

 

if you want all players to revieve

use all#607#1

 

if you want a specific map to rain a item

use map#607#1#map_name

example map#607#1#izlude

this does not required whether the gm or admin is in the izlude map. But gives all players items in izlude 

 

edit*

whisper npc:fi

Edited by xyxzero
Link to comment
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.   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.

×
×
  • Create New...