Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #if AMXX_VERSION_NUM < 183
- #define MAX_PLAYERS 32
- #endif
- #define PREFIX "^x04[^x01PREFIX^x04] "
- #define SENDCHATMESSAGE(%1,%2) ColorChat(%1, RED, %2)
- #define GETUSERTEAM(%1) get_user_team(%1)
- #define GETUSERNAME(%1,%2,%3) get_user_name(%1, %2, %3)
- stock get_players_by_name(id, iPlayersParam[MAX_PLAYERS], &iCount, szString[50])
- {
- new iPlayers[32], iPlayersNum
- get_players(iPlayers, iPlayersNum)
- if (szString[0] == '@')
- {
- if (equal(szString, "@random"))
- {
- return iPlayers[random(iPlayersNum - 1)]
- }
- const c_iASCIINumberFactor = 48
- new iTeam = szString[1] - c_iASCIINumberFactor
- for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
- {
- if (GETUSERTEAM(iPlayers[iPlayersNum]) == iTeam)
- {
- iPlayersParam[iCount++] = iPlayers[iPlayersNum]
- }
- }
- }
- for (--iPlayersNum; iPlayersNum >= 0; iPlayersNum--)
- {
- if (contain(GETUSERNAME(iPlayers[iPlayersNum]), szString))
- {
- iPlayersParam[iCount++] = iPlayers[iPlayersNum]
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement