Advertisement
DraKiNs

[COD] kDetector (ProxDetector)

Jun 27th, 2011
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.14 KB | None | 0 0
  1. kDetector(Float: radi, playerid, string[], color)
  2. {
  3.     if(!IsPlayerConnected(playerid)) return false;
  4.  
  5.     static kPos[3];
  6.     GetPlayerPos(playerid, kPos[0], kPos[1], kPos[2]);
  7.  
  8.     for(new i; i < MAX_PLAYERS; ++i) if(IsPlayerConnected(i)) {
  9.         if(IsPlayerInRangeOfPoint(i, radi, kPos[0], kPos[1], kPos[2])) {
  10.             SendClientMessage(i, color1, string);
  11.             continue;
  12.         }
  13.         if(IsPlayerInRangeOfPoint(i, radi*2, kPos[0], kPos[1], kPos[2])) {
  14.             SendClientMessage(i, color2, string);
  15.             continue;
  16.         }
  17.         if(IsPlayerInRangeOfPoint(i, radi*3, kPos[0], kPos[1], kPos[2])) {
  18.             SendClientMessage(i, color3, string);
  19.         }
  20.     }
  21.     return true;
  22. }
  23.  
  24.  
  25. kDetector(Float: radi, playerid, string[], color)
  26. {
  27.     if(!IsPlayerConnected(playerid)) return false;
  28.  
  29.     static kPos[3];
  30.     GetPlayerPos(playerid, kPos[0], kPos[1], kPos[2]);
  31.  
  32.     for(new i; i < MAX_PLAYERS; i++) {
  33.         if(!IsPlayerInRangeOfPoint(i, radi, kPos[0], kPos[1], kPos[2])) continue;
  34.  
  35.         SendClientMessage(i, color, string);
  36.     }
  37.     return true;
  38. }
  39.  
  40. // By The Knight
  41. // Change by DraKiNs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement