Advertisement
akbare

Give Reward to player with GM whisper

Dec 5th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. - script reward -1,{
  2.  
  3. OnInit:
  4. // Configuration
  5. .reward_id = 7720;
  6. .amount = 5;
  7. .min_gm = 40;
  8. end;
  9.  
  10.  
  11. OnWhisperGlobal:
  12. // Check GM level
  13. if (getgmlevel() < .min_gm) {
  14. message strcharinfo(0), "You are not authorised to access this feature.";
  15. end;
  16. }
  17.  
  18. // Check if reward session ended
  19. if (select("Reward a player:End session") == 2) {
  20. close;
  21. }
  22.  
  23. do {
  24. // Input target player's name
  25. message strcharinfo(0), "Enter the name of the character to be rewarded.";
  26. input .@player_name$;
  27.  
  28. // Check if specified player is logged in
  29. if (!isloggedin(getcharid(3, .@player_name$), getcharid(0, .@player_name$))) {
  30. message strcharinfo(0), "'"+ .@player_name$ +"' is either not logged in or does not exist.";
  31. }
  32. } while (!isloggedin(getcharid(3, .@player_name$), getcharid(0, .@player_name$)));
  33.  
  34. // Reward specified player
  35. getitem .reward_id, .amount, getcharid(3, .@player_name$);
  36.  
  37. // Announce reward
  38. announce "The GM '"+ strcharinfo(0) +"' has rewarded '"+ .@player_name$ +"' with "+ .amount +" "+ getitemname(.reward_id) +".", bc_all;
  39. close;
  40.  
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement