Jump to content
  • 0

Prize NPC


Rage Guy

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

I Got a prize npc

but he dont send prizes to all online players

only some of them

i want him to send to every one

 

ayo_in02,108,161,4	script	Prize Sender	437,{
if(!getgmlevel())end;
set .@itemtoonlineplayers$,strcharinfo(0);

mes "Input Item ID";
	Input .@item;
	if (getitemname(.@item) == "null") {
		mes "Invalid Item ID";
		close;
	}

mes "Input Amount";
	input .@inum;
	if( .@inum <= 0  ) {
		mes "Invalid Amount";
		close;
	}

	while( .@V < $PlayerNumber ){
		set .@V,.@V+1;
		message getd("$RecordAID"+.@V),"[[[ System ]]] : "+.@itemtoonlineplayers$+" give you "+getitemname(.@item)+"x"+.@inum;
		getitem .@item,.@inum,getd("$RecordAID"+.@V);
	}

close;
}

-	script	PrizeSenderEvent	-1,{
OnInit:
	if(!getusers(1))while($PlayerNumber)setd "$RecordAID"+(set($PlayerNumber,

$PlayerNumber-1)+1),0;
	end;

OnPCLoginEvent:
	setd "$RecordAID"+set(@AIDNumber,set($PlayerNumber,$PlayerNumber+1)),getcharid(3);
	end;

OnPCLogoutEvent:
	setd "$RecordAID"+@AIDNumber,getd("$RecordAID"+(set(.@AIDNumber,set($PlayerNumber,

$PlayerNumber-1)+1)));
	attachrid getd("$RecordAID"+@AIDNumber);
	setd "$RecordAID"+@AIDNumber,0;
	set @AIDNumber,.@AIDNumber;

}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Try this one :

prontera,155,170,5	script	Gift	87,{
	if( getgmlevel() < 60 ) end;
	if( select( "Give an item", "Leave" ) -1 ) end;
	input .@item_id;
	if( getiteminfo( .@item_id,0 ) == -1 ) {
		mes "Unknown item id.";
		close;
	}
	input .@amount;
	if( .@amount <= 0  ) {
		mes "Invalid Amount";
		close;
	}
	set .@item_name$, getitemname( .@item_id );
	set .@gm_name$, strcharinfo(0);
	do {
		set .@size, query_sql( "SELECT `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ ( .@loop *128 ) +", 128", .@account_id );
		for( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) {
			getitem .@item_id, .@amount, .@account_id[.@i];
			message rid2name( .@account_id[.@i] ), "You get an "+ .@item_name$ +" from "+ .@gm_name$ +".";
		}
		set .@loop, .@loop +1;
	}
	while( .@size );
	mes "Done.";
	close;
}

A GM lvl > 59 can give any item to all players online

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

made this not long ago ~ = )

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

 

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

  • Upvote 1
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...