Jump to content

Question

Posted

hi all ,,,

i need rewards script

give prizes for all online players

and give only 1 time for the same ip "if can "

 

and i talk to npc "with my gm " to give prize and i put id,amount

 

any one can give me this script ?

 

and thanks :D

4 answers to this question

Recommended Posts

Posted (edited)

That was funny  :lol:

 

I think he's not looking for a daily reward system.

-	script	reward npc	-1,{
OnInit:
	bindatcmd "reward",strnpcinfo(0)+"::OnReward",40;
	end;
OnReward:
	.@nb = query_sql ("SELECT `name` FROM `ragnarok`.`char` WHERE `online` = '1' AND `account_id` NOT IN (SELECT `account_id` FROM `ragnarok`.`login` WHERE `group_id` > '0') LIMIT 128",.@players$);
	mes "["+strnpcinfo(0)+"]";
	if (.@nb == -1) { mes "No player is connected.." ; close; }
	if (.@nb == 128) { mes "There are too many players for me to handle.." ; close; }
	mes "Hi there!","I can give items to every players connected","","Players connected : ^0000ff"+.@nb+"^000000";
	next;
	if (select("Give items:Leave") == 2) end;
	while (!.@ok) {
		mes "["+strnpcinfo(0)+"]";
		mes "please ^0000ffinput the id of the item^000000 you want to give to players.";
		input .@id,501;
		mes "","Item selected : ^ff0000"+getitemname(.@id)+"^000000";
		.@s = select("Next:Change item:Leave");
		next;
		if (.@s == 3) end;
		if (.@s == 1) .@ok = 1;
	}
	while (!.@ok2) {
		mes "["+strnpcinfo(0)+"]";
		mes "please ^0000ffinput the amount^000000 you want to give to players.";
		input .@amount,1;
		mes "","Amount : ^ff0000"+.@amount+"^000000";
		.@s = select("Next:Change amount:Leave");
		next;
		if (.@s == 3) end;
		if (.@s == 1) .@ok2 = 1;
	}
	mes "["+strnpcinfo(0)+"]";
	mes "Do you want to announce something?";
	next;
	.@s = select("Custom announce:Automatic announce:No announce:Leave");
	if (.@s == 4) end;
	if (.@s == 3) .@noannounce = 1;
	if (.@s == 1) {
		mes "["+strnpcinfo(0)+"]";
		mes "Please input your announce.";
		input .@announce$;
	}
	close2;
	if (!.@noannounce) {
		if (.@announce$ != "") announce .@announce$,0;
		else announce "Here for you all! Hope you enjoy!",0;
	}
	for (.@i = 0 ; .@i < .@nb ; .@i++)
		if (attachrid(getcharid(3,.@players$[.@i]))) getitem .@id,.@amount;
}

Don't know if you found something already but if you didn't you can use this.

type '@reward' in-game and you will be able to give items to all players online.

 

Note for SQL pros ^^:

I couldn't find a way to select names with distinct account_id with my query so if someone know how to do so I'm really curious please tell me  ^_^ 

Even so I don't think it's a problem since you shouldn't be connected with more than one of your characters.

Edited by Kurofly

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