Jump to content
  • 0

Give Rewards thru whisper


Heartbreak

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   0
  • Joined:  12/02/12
  • Last Seen:  

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

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  135
  • Reputation:   41
  • Joined:  02/05/14
  • Last Seen:  

-	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;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

I will do this later. I am on my phone now so i can't help

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   0
  • Joined:  12/02/12
  • Last Seen:  

woo ! you're the best ! thanks a lot ! :D 

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