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