Jump to content
  • 0

Give Rewards thru whisper


Question

Posted

can I please request for a reward giver script that works like this:
 

- GM will pm the npc to activate..

- NPC will ask for the name of the player..

- when GM type the name of the player it will automatically give the player the reward (item 7720) and announce that this player is the winner of the event and got 5 Event coins..

- should work only for gm level 40 and up..

- if the GM typed the wrong name.. it will give gm a message to try again.. 

 

can anyone help me ? im a newbie scripter.. :(

3 answers to this question

Recommended Posts

Posted
-	script	reward	-1,{

	OnInit:
		// Configuration
		.reward_id = 7720;
		.amount = 5;
		.min_gm = 40;
		end;


	OnWhisperGlobal:
		// Check GM level
		if (getgmlevel() < .min_gm) {
			message strcharinfo(0), "You are not authorised to access this feature.";
			end;
		}

		// Check if reward session ended
		if (select("Reward a player:End session") == 2) {
			close;
		}

		do {
			// Input target player's name
			message strcharinfo(0), "Enter the name of the character to be rewarded.";
			input .@player_name$;

			// Check if specified player is logged in
			if (!isloggedin(getcharid(3, .@player_name$), getcharid(0, .@player_name$))) {
				message strcharinfo(0), "'"+ .@player_name$ +"' is either not logged in or does not exist.";
			}
		} while (!isloggedin(getcharid(3, .@player_name$), getcharid(0, .@player_name$)));

		// Reward specified player
		getitem .reward_id, .amount, getcharid(3, .@player_name$);

		// Announce reward
		announce "The GM '"+ strcharinfo(0) +"' has rewarded '"+ .@player_name$ +"' with "+ .amount +" "+ getitemname(.reward_id) +".", bc_all;
		close;

}

Whisper to npc:reward to activate the GM panel; anyone below GM level 40 will be replied to with a fail message. I suspect you might be using eAthena, though; in which case, change lines 5 through 7 for compatibility:

	OnInit:
		// Configuration
		set .reward_id, 7720;
		set .amount, 5;
		set .min_gm, 40;
		end;

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