Jump to content
  • 0

If i want to give item to player Lv 50+


ooGubAoo

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.05
  • Content Count:  43
  • Reputation:   1
  • Joined:  06/08/23
  • Last Seen:  

-	script	Free	-1,{

// SET TIME
	OnClock0000:

// SET ITEM ID.
	set .@item_id,501;
	
// SET NUMBER TO GIVE.
	set .@amout,5;
	
	set .@item_name$, getitemname( .@item_id );
	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, .@amout, .@account_id[.@i];
			message rid2name( .@account_id[.@i] ), "ท่านได้ของรางวัลเป็น "+ .@item_name$ +".";
		}
		set .@loop, .@loop +1;
	}
	while( .@size );
end;
}

if i need ti fix player lv 50.

When online in game will can get item.

Thank you.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

-	script	GIVEAWAY	FAKE_NPC,{
	OnInit:
		.min_lvl = 50;
		.item_id = 501;
		.amount = 5;

		.item_name = getitemname(.item_id);
	end;

	OnClock0000:
		addrid(0);

		if(BaseLevel < .min_lvl) end;

		getitem(.item_id, .amount);
		message(strcharinfo(0), "ท่านได้ของรางวัลเป็น " +  .item_name + ".");
}

 

Edited by Winterfox
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.05
  • Content Count:  43
  • Reputation:   1
  • Joined:  06/08/23
  • Last Seen:  

Thank you very much.

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