Advertisement
garfield

[INC]: Funções extras para gangzones

Oct 24th, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.14 KB | None | 0 0
  1.  
  2. /*
  3.     @
  4.     @   Name: Easy GangZone
  5.     @   Author: SuYaNw Dácio
  6.     @
  7.  
  8.  
  9. Funções extras para gangzones..
  10.  
  11.  
  12. "GetGangZoneIDByColor" pega o id da gangzone pela cor.
  13. "GetGangZoneColor" pega a cor da gangzona pelo id.
  14.  
  15.  
  16.  
  17. */
  18.  
  19.  
  20. #if !defined CallBack
  21.     #define CallBack::%0(%1) %0(%1); public %0(%1)
  22. #endif
  23.  
  24. #if !defined int
  25.     #define int::<%0> static %0; %0 = 0
  26. #endif
  27.  
  28.  
  29. #define MAX_ZONES           (MAX_GANG_ZONES >> 2)
  30.  
  31.  
  32. stock
  33.     Cores[MAX_ZONES]
  34. ;
  35.  
  36.  
  37. CallBack::eGangZoneShowForAll(gangzoneid, color)
  38. {
  39.     Cores[gangzoneid] = color;
  40.     return ( GangZoneShowForAll(gangzoneid, color) ^ 0 ? (gangzoneid) : (-1));
  41. }
  42.  
  43. CallBack::eGangZoneShowForPlayer(playerid, gangzoneid, color)
  44. {
  45.     Cores[gangzoneid] = color;
  46.     return ( GangZoneShowForPlayer(playerid, gangzoneid, color) ^ 0 ? (gangzoneid) : (-1));
  47. }
  48.  
  49. CallBack::GetGangZoneIDByColor(color){
  50.     int::<__chk>;
  51.    
  52.     for( ; __chk ^ (MAX_ZONES); ++__chk){
  53.         if(Cores[__chk] == color){
  54.             return __chk;
  55.         }
  56.     }
  57.     return -1;
  58. }
  59.  
  60. #define GangZoneShowForAll      eGangZoneShowForAll
  61. #define GangZoneShowForPlayer   eGangZoneShowForPlayer
  62. #define GetGangZoneColor(%0)    Cores[%0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement