Advertisement
Guest User

ShittyCode for SmirnoffBG

a guest
Jan 22nd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.01 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #if AMXX_VERSION_NUM < 183
  4.     #define MAX_PLAYERS 32
  5. #endif
  6.  
  7. #define PREFIX                  "^x04[^x01PREFIX^x04] "
  8. #define SENDCHATMESSAGE(%1,%2)  ColorChat(%1, RED, %2)
  9. #define GETUSERTEAM(%1)         get_user_team(%1)
  10. #define GETUSERNAME(%1,%2,%3)   get_user_name(%1, %2, %3)
  11.  
  12. stock get_players_by_name(id, iPlayersParam[MAX_PLAYERS], &iCount, szString[50])
  13. {
  14.     new iPlayers[32], iPlayersNum
  15.     get_players(iPlayers, iPlayersNum)
  16.  
  17.     if (szString[0] == '@')
  18.     {
  19.         if (equal(szString, "@random"))
  20.         {
  21.             return iPlayers[random(iPlayersNum - 1)]
  22.         }
  23.  
  24.         const c_iASCIINumberFactor = 48
  25.         new iTeam = szString[1] - c_iASCIINumberFactor
  26.         for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
  27.         {
  28.             if (GETUSERTEAM(iPlayers[iPlayersNum]) == iTeam)
  29.             {
  30.                 iPlayersParam[iCount++] = iPlayers[iPlayersNum]
  31.             }
  32.         }
  33.     }
  34.  
  35.     for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
  36.     {
  37.         if (contain(GETUSERNAME(iPlayers[iPlayersNum]), szString))
  38.         {
  39.             iPlayersParam[iCount++] = iPlayers[iPlayersNum]
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement