DiogoB

[Pawn] Detector (Chat perto) (2 versões)

Feb 6th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.26 KB | None | 0 0
  1. //Versão 1
  2. Detector(Float: radi, playerid, string[], color)
  3. {
  4.     if(!IsPlayerConnected(playerid))
  5.         return false;
  6.  
  7.     static Pos[3];
  8.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  9.  
  10.     for(new i; i < GetMaxPlayers(); ++i)
  11.     {
  12.         if(IsPlayerConnected(i))
  13.         {
  14.             if(IsPlayerInRangeOfPoint(i, radi, Pos[0], Pos[1], Pos[2]))
  15.             {
  16.                 SendClientMessage(i, color1, string);
  17.                 continue;
  18.             }
  19.             if(IsPlayerInRangeOfPoint(i, radi*2, Pos[0], Pos[1], Pos[2]))
  20.             {
  21.                 SendClientMessage(i, color2, string);
  22.                 continue;
  23.             }
  24.             if(IsPlayerInRangeOfPoint(i, radi*3, Pos[0], Pos[1], Pos[2]))
  25.             {
  26.                 SendClientMessage(i, color3, string);
  27.             }
  28.         }
  29.     }
  30.     return true;
  31. }
  32.  
  33. //Versão 2
  34. Detector(Float: radi, playerid, string[], color)
  35. {
  36.     if(!IsPlayerConnected(playerid))
  37.         return false;
  38.  
  39.     static Pos[3];
  40.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  41.  
  42.     for(new i; i < GetMaxPlayers(); i++)
  43.     {
  44.         if(!IsPlayerInRangeOfPoint(i, radi, Pos[0], Pos[1], Pos[2])) continue;
  45.  
  46.         SendClientMessage(i, color, string);
  47.     }
  48.     return true;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment