Advertisement
Filiq_

/areaheal

Aug 24th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.75 KB | None | 0 0
  1. CMD:areaheal(playerid, params[]) {
  2.  
  3.     if(!Iter_Contains(Admin, playerid)) return SendClientMessage(playerid, COLOR_GREY, AdminOnly);
  4.     new
  5.         Range = strval(params);
  6.         Heal = 0;
  7.     if(sscanf(params, "ii", Range, Heal)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/areaheal [ range ] [ heal ]");
  8.     if(Range == 0 || Range >= 1000)  return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/areaheal [ range ] [ heal ]");
  9.     if(Heal == 0 || Heal > 100)  return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/areaheal [ range ] [ heal ]");
  10.  
  11.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  12.     foreach(new i : Player) {
  13.         if(!IsPlayerInRangeOfPoint(i, Range, Pos[0], Pos[1], Pos[2])) continue;
  14.         SetPlayerHealth(playerid, Heal);
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement