Jump to content
  • 0

Send to all Online Players


Question

Posted

Can someone please give me this script?

 

 

- A NPC that only GM can Talk

- A NPC that will send an Item to all Online Players except those players whose on Vend Mode and Pub

- A NPC that will show How many Players online

 

 

 

thats all i really wanted please! 

1 answer to this question

Recommended Posts

Posted

Like this ?

prontera,155,170,5	script	Send an item	56,{
	if( getgmlevel() < 98 ) end;	// only gm >= 99 can talk
	mes "There is currently ^ff0000"+ getusers(1) +"^000000 player(s) online.";
	mes "You can add an item to all player, except whose on vending or chatting mode.";
	next;
	if( select( "Send an item ID", "Leave" ) -1 ) close;
	input .@item_id;
	if( getiteminfo( .@item_id,0 ) == -1 ) {
		mes "Unknown item id.";
		close;
	}
	set .@item_name$, getitemname( .@item_id );
	set .@gm_name$, strcharinfo(0);
	do {
		set .@size, query_sql( "SELECT `account_id`, `name` from `char` where `online` = '1' and `char_id` != "+ getcharid(0) +" order by `account_id` desc limit "+ ( .@loop *128 ) +", 128", .@account_id, .@name$ );
		for( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) {
			if ( checkvending( .@name$[.@i] ) || checkchatting( .@name$[.@i] ) ) continue;
			getitem .@item_id, 1, .@account_id[.@i];
			message rid2name( .@account_id[.@i] ), "GM "+ .@gm_name$ +" give you an "+ .@item_name$ +".";
		}
		set .@loop, .@loop +1;
	}
	while( .@size );
	mes "Done.";
	close;
}

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