Approved Chat Prefix

Plug-ins compatibility with Zombie Escape 1.x only!


User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#51

Post by Mark » 5 years ago

Jack GamePlay wrote: 5 years ago
czirimbolo wrote: 5 years ago here is my ini. file, I didnt change anything, just uploaded his file

Code: Select all

// Zombie escape chat prefixes
// Syntax is:
// "Prefix" "Access for it"

// Notes:
// Check users.ini for the access letters
// Don't add any custom characters in access such as:
// #, ; , % , etc.. or even space
// Those are some examples i've provided.

"Owner" "g"
"Admin" "bcde"
"VIP" "t"
"User" "z"
Try this AMXX file.
Where the sma for this amxx file?

Also

How can i set it to read from vip.ini so if someone has vip if will give them that tag?

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#52

Post by Spir0x » 5 years ago

Jack GamePlay wrote: 5 years ago
czirimbolo wrote: 5 years ago here is my ini. file, I didnt change anything, just uploaded his file

Code: Select all

// Zombie escape chat prefixes
// Syntax is:
// "Prefix" "Access for it"

// Notes:
// Check users.ini for the access letters
// Don't add any custom characters in access such as:
// #, ; , % , etc.. or even space
// Those are some examples i've provided.

"Owner" "g"
"Admin" "bcde"
"VIP" "t"
"User" "z"
Try this AMXX file.
Jack please give me the SMA file !! you're sma one in the rar showing only levels without the other prefixes.

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#53

Post by Night Fury » 5 years ago

RapidFlush wrote: 5 years ago
Where the sma for this amxx file?

Also

How can i set it to read from vip.ini so if someone has vip if will give them that tag?
Why do you want to do this?
You can already set a default VIP flag in ze_customprefixes & make that's prefix VIP.
Spir0x wrote: 5 years ago Jack please give me the SMA file !! you're sma one in the rar showing only levels without the other prefixes.
Here you both the code.
Try it.
  1. #include <zombie_escape>
  2. #include <ze_levels>
  3.  
  4. // Custom prefixes file
  5. new const ZE_CUSTOMPREFIX[] = "ze_customprefix"
  6.  
  7. // Edit each prefix class here
  8. /* There are 3 colors:
  9.  *  ^1 => Yellow
  10.  *  ^4 => Green
  11.  *  ^3 => Team color => blue for CT, red for T, white/gray for Spec
  12. */
  13.  
  14. new const szCT_Prefix[] = "^3Humans"
  15. new const szT_Prefix[] = "^3Zombies"
  16. new const szSpecT_Prefix[] = "^3Spectators"
  17. new const szDead_Prefix[] = "^4Dead"
  18. new const szLevel_Prefix[] = "^4Level"
  19.  
  20. new g_szPrefixPrefixes[32], g_szFile[64]
  21. new g_iMaxPlayers, g_iSayText
  22. new g_pCvarLogMessages
  23. new Array:g_szPrefixes, Array:g_szFlags
  24.  
  25. new const g_szReservedChars[] = {
  26.     ';', '$', '#', '*', '!',
  27.     '@', '%', '&', '(', ')',
  28.     '[', ']', '>', '<', EOS
  29. }
  30.  
  31. public plugin_init()
  32. {
  33.     register_plugin("[ZE] Addons: Prefixes", "1.3", "Jack GamePlay")
  34.  
  35.     register_clcmd("say", "Hook_Say")
  36.     register_clcmd("say_team", "Hook_SayTeam")
  37.  
  38.     g_pCvarLogMessages = register_cvar("ze_log_messages", "0")
  39.  
  40.     g_iMaxPlayers = get_member_game(m_nMaxPlayers)
  41.     g_iSayText = get_user_msgid("SayText")
  42.  
  43.     register_message(g_iSayText, "BlockDoubleMessages")
  44.  
  45.     get_configsdir(g_szFile, charsmax(g_szFile))
  46.     formatex(g_szFile, charsmax(g_szFile), "%s/%s.ini", g_szFile, ZE_CUSTOMPREFIX)
  47.  
  48.     g_szPrefixes = ArrayCreate(32, 1)
  49.     g_szFlags = ArrayCreate(32, 1)
  50. }
  51.  
  52. public BlockDoubleMessages()
  53. {
  54.     return PLUGIN_HANDLED
  55. }
  56.  
  57. public Hook_Say(id)
  58. {
  59.     if (!is_user_connected(id))
  60.         return PLUGIN_CONTINUE
  61.  
  62.     new szName[32], iLevelNum, szMessage[200], szPrefixes[64]
  63.     get_user_name(id, szName, charsmax(szName))
  64.     iLevelNum = ze_get_user_level(id)
  65.     read_args(szMessage, charsmax(szMessage))
  66.     remove_quotes(szMessage)
  67.     trim(szMessage)
  68.    
  69.     for(new iChar = 0; iChar <= charsmax(szMessage); iChar++)
  70.     {
  71.         if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4')
  72.             szMessage[iChar] = '^1'
  73.     }
  74.  
  75.     if (!is_valid_msg(szMessage))
  76.         return PLUGIN_CONTINUE
  77.  
  78.     LookUPPrefixes(id)
  79.  
  80.     if (strlen(g_szPrefixPrefixes))
  81.         formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum)
  82.     else
  83.         formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum)
  84.  
  85.     // Message format
  86.     if (is_user_alive(id))
  87.         format(szMessage, charsmax(szMessage), "^1[%s^1] ^3%s ^1: ^1%s", szPrefixes, szName, szMessage)
  88.     else
  89.         format(szMessage, charsmax(szMessage), "^1[%s ^1| %s^1] ^3%s ^1: ^1%s", szDead_Prefix, szPrefixes, szName, szMessage)
  90.  
  91.     // Send the message
  92.     for (new i = 1; i <= g_iMaxPlayers; i++)
  93.     {
  94.         if (!is_user_connected(i))
  95.             continue
  96.  
  97.         Send_Message(szMessage, id, i)
  98.     }
  99.  
  100.     // Log messages
  101.     if (get_pcvar_num(g_pCvarLogMessages))
  102.     {
  103.         new szSteamID[36], szIP[16]
  104.         get_user_authid(id, szSteamID, charsmax(szSteamID))
  105.         get_user_ip(id, szIP, charsmax(szIP), 1)
  106.         Log_Messages("[%s|%s] %s", szSteamID, szIP, szMessage)
  107.     }
  108.    
  109.     return PLUGIN_CONTINUE
  110. }
  111.  
  112. public Hook_SayTeam(id)
  113. {  
  114.     if (!is_user_connected(id))
  115.         return PLUGIN_CONTINUE
  116.        
  117.     new szName[32], szMessage[200], szTeamName[32], szPrefixes[64], iLevelNum
  118.     get_user_name(id, szName, charsmax(szName))
  119.     iLevelNum = ze_get_user_level(id)
  120.     read_args(szMessage, charsmax(szMessage))
  121.     remove_quotes(szMessage)
  122.     trim(szMessage)
  123.  
  124.     for(new iChar = 0; iChar <= charsmax(szMessage); iChar++)
  125.     {
  126.         if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4')
  127.             szMessage[iChar] = '^1'
  128.     }
  129.  
  130.     if (!is_valid_msg(szMessage))
  131.         return PLUGIN_CONTINUE
  132.  
  133.     // Team check
  134.     switch(get_member(id, m_iTeam))
  135.     {
  136.         case TEAM_CT: formatex(szTeamName, charsmax(szTeamName), szCT_Prefix)
  137.         case TEAM_TERRORIST: formatex(szTeamName, charsmax(szTeamName), szT_Prefix)
  138.         case TEAM_SPECTATOR: formatex(szTeamName, charsmax(szTeamName), szSpecT_Prefix)
  139.     }
  140.  
  141.     LookUPPrefixes(id)
  142.  
  143.     // Prefixes check
  144.     if (strlen(g_szPrefixPrefixes))
  145.         formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum)
  146.     else
  147.         formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum)
  148.  
  149.     // Message foramt
  150.     if(is_user_alive(id))
  151.         format(szMessage, charsmax(szMessage), "^1(%s^1) [%s^1] ^3%s ^1: ^1%s", szTeamName, szPrefixes, szName, szMessage)
  152.     else
  153.         format(szMessage, charsmax(szMessage), "^1(%s^1) [%s ^1| %s^1] ^3%s ^1: ^1%s", szTeamName, szDead_Prefix, szPrefixes, szName, szMessage)
  154.  
  155.     // Send the message
  156.     for (new i = 1; i <= g_iMaxPlayers; i++)
  157.     {
  158.         if(!is_user_connected(i) || get_user_team(i) != get_user_team(id))
  159.             continue
  160.  
  161.         Send_Message(szMessage, id, i)
  162.     }
  163.  
  164.     // Log messages
  165.     if (get_pcvar_num(g_pCvarLogMessages))
  166.     {
  167.         new szSteamID[36], szIP[16]
  168.         get_user_authid(id, szSteamID, charsmax(szSteamID))
  169.         get_user_ip(id, szIP, charsmax(szIP), 1)
  170.         Log_Messages("[%s|%s] - %s", szSteamID, szIP, szMessage)
  171.     }
  172.    
  173.     return PLUGIN_CONTINUE
  174. }
  175.  
  176. bool:is_valid_msg(const szMessage[])
  177. {
  178.     if (szMessage[0] == '@' || !strlen(szMessage) || szMessage[0] == '/' || szMessage[0] == '#')
  179.         return false
  180.        
  181.     return true
  182. }
  183.  
  184. stock Log_Messages(const szMessage_Fmt[], any:...)
  185. {
  186.     static szMessage[256], szFileName[32], szDate[16]
  187.     vformat(szMessage, charsmax(szMessage), szMessage_Fmt, 2)
  188.     replace_all(szMessage, charsmax(szMessage), "^4", "")
  189.     replace_all(szMessage, charsmax(szMessage), "^1", "")
  190.     replace_all(szMessage, charsmax(szMessage), "^1", "")
  191.     replace_all(szMessage, charsmax(szMessage), "^3", "")
  192.     format_time(szDate, charsmax(szDate), "%d%m%Y")
  193.     formatex(szFileName, charsmax(szFileName), "ZE_Messages_%s.log", szDate)
  194.     log_to_file(szFileName, "%s", szMessage)
  195. }
  196.  
  197. stock Send_Message(const szMessage[], const id, const iIndex)
  198. {
  199.     message_begin(MSG_ONE, g_iSayText, {0, 0, 0}, iIndex)
  200.     write_byte(id)
  201.     write_string(szMessage)
  202.     message_end()
  203. }
  204.  
  205. public ReadLines()
  206. {
  207.     if (file_exists(g_szFile))
  208.     {
  209.         new OpennedFile = fopen(g_szFile, "rt"),
  210.             szLineToRead[129], szPrefixFlags[32], szPrefixPrefix[32]
  211.  
  212.         if (!OpennedFile)
  213.             return
  214.        
  215.         while (!feof(OpennedFile))
  216.         {
  217.             fgets(OpennedFile, szLineToRead, charsmax(szLineToRead))
  218.  
  219.             if ((szLineToRead[0] == '/' && szLineToRead[1] == '/'))
  220.                 continue
  221.  
  222.             for (new iIndex = 0; iIndex <= charsmax(g_szReservedChars); iIndex++)
  223.             {
  224.                 if (equal(szLineToRead[0], g_szReservedChars[iIndex]))
  225.                     continue
  226.             }
  227.            
  228.             remove_quotes(szLineToRead)
  229.             trim(szLineToRead)
  230.             parse(szLineToRead, szPrefixPrefix, charsmax(szPrefixPrefix), szPrefixFlags, charsmax(szPrefixFlags))
  231.             ArrayPushString(g_szPrefixes, szPrefixPrefix)
  232.             ArrayPushString(g_szFlags, szPrefixFlags)
  233.         }
  234.        
  235.         fclose(OpennedFile)
  236.     }
  237.     else
  238.     {
  239.         set_fail_state("File %s is not found.", g_szFile)
  240.     }
  241. }
  242.  
  243. public LookUPPrefixes(id)
  244. {
  245.     ReadLines()
  246.  
  247.     new szPrefixFlags[32], iIndex, szPrefixPrefix[32]
  248.     for (iIndex = 0; iIndex < ArraySize(g_szFlags); iIndex++)
  249.     {
  250.         ArrayGetString(g_szFlags, iIndex, szPrefixFlags, charsmax(szPrefixFlags))
  251.  
  252.         if (access(id, read_flags(szPrefixFlags)))
  253.         {
  254.             ArrayGetString(g_szPrefixes, iIndex, szPrefixPrefix, charsmax(szPrefixPrefix))
  255.             copy(g_szPrefixPrefixes, charsmax(g_szPrefixPrefixes), szPrefixPrefix)
  256.             break
  257.         }
  258.     }
  259. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#54

Post by Mark » 5 years ago

Jack GamePlay wrote: 5 years ago
RapidFlush wrote: 5 years ago
Where the sma for this amxx file?

Also

How can i set it to read from vip.ini so if someone has vip if will give them that tag?
Why do you want to do this?
You can already set a default VIP flag in ze_customprefixes & make that's prefix VIP.
Spir0x wrote: 5 years ago Jack please give me the SMA file !! you're sma one in the rar showing only levels without the other prefixes.
Here you both the code.
Try it.
  1. #include <zombie_escape>
  2. #include <ze_levels>
  3.  
  4. // Custom prefixes file
  5. new const ZE_CUSTOMPREFIX[] = "ze_customprefix"
  6.  
  7. // Edit each prefix class here
  8. /* There are 3 colors:
  9.  *  ^1 => Yellow
  10.  *  ^4 => Green
  11.  *  ^3 => Team color => blue for CT, red for T, white/gray for Spec
  12. */
  13.  
  14. new const szCT_Prefix[] = "^3Humans"
  15. new const szT_Prefix[] = "^3Zombies"
  16. new const szSpecT_Prefix[] = "^3Spectators"
  17. new const szDead_Prefix[] = "^4Dead"
  18. new const szLevel_Prefix[] = "^4Level"
  19.  
  20. new g_szPrefixPrefixes[32], g_szFile[64]
  21. new g_iMaxPlayers, g_iSayText
  22. new g_pCvarLogMessages
  23. new Array:g_szPrefixes, Array:g_szFlags
  24.  
  25. new const g_szReservedChars[] = {
  26.     ';', '$', '#', '*', '!',
  27.     '@', '%', '&', '(', ')',
  28.     '[', ']', '>', '<', EOS
  29. }
  30.  
  31. public plugin_init()
  32. {
  33.     register_plugin("[ZE] Addons: Prefixes", "1.3", "Jack GamePlay")
  34.  
  35.     register_clcmd("say", "Hook_Say")
  36.     register_clcmd("say_team", "Hook_SayTeam")
  37.  
  38.     g_pCvarLogMessages = register_cvar("ze_log_messages", "0")
  39.  
  40.     g_iMaxPlayers = get_member_game(m_nMaxPlayers)
  41.     g_iSayText = get_user_msgid("SayText")
  42.  
  43.     register_message(g_iSayText, "BlockDoubleMessages")
  44.  
  45.     get_configsdir(g_szFile, charsmax(g_szFile))
  46.     formatex(g_szFile, charsmax(g_szFile), "%s/%s.ini", g_szFile, ZE_CUSTOMPREFIX)
  47.  
  48.     g_szPrefixes = ArrayCreate(32, 1)
  49.     g_szFlags = ArrayCreate(32, 1)
  50. }
  51.  
  52. public BlockDoubleMessages()
  53. {
  54.     return PLUGIN_HANDLED
  55. }
  56.  
  57. public Hook_Say(id)
  58. {
  59.     if (!is_user_connected(id))
  60.         return PLUGIN_CONTINUE
  61.  
  62.     new szName[32], iLevelNum, szMessage[200], szPrefixes[64]
  63.     get_user_name(id, szName, charsmax(szName))
  64.     iLevelNum = ze_get_user_level(id)
  65.     read_args(szMessage, charsmax(szMessage))
  66.     remove_quotes(szMessage)
  67.     trim(szMessage)
  68.    
  69.     for(new iChar = 0; iChar <= charsmax(szMessage); iChar++)
  70.     {
  71.         if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4')
  72.             szMessage[iChar] = '^1'
  73.     }
  74.  
  75.     if (!is_valid_msg(szMessage))
  76.         return PLUGIN_CONTINUE
  77.  
  78.     LookUPPrefixes(id)
  79.  
  80.     if (strlen(g_szPrefixPrefixes))
  81.         formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum)
  82.     else
  83.         formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum)
  84.  
  85.     // Message format
  86.     if (is_user_alive(id))
  87.         format(szMessage, charsmax(szMessage), "^1[%s^1] ^3%s ^1: ^1%s", szPrefixes, szName, szMessage)
  88.     else
  89.         format(szMessage, charsmax(szMessage), "^1[%s ^1| %s^1] ^3%s ^1: ^1%s", szDead_Prefix, szPrefixes, szName, szMessage)
  90.  
  91.     // Send the message
  92.     for (new i = 1; i <= g_iMaxPlayers; i++)
  93.     {
  94.         if (!is_user_connected(i))
  95.             continue
  96.  
  97.         Send_Message(szMessage, id, i)
  98.     }
  99.  
  100.     // Log messages
  101.     if (get_pcvar_num(g_pCvarLogMessages))
  102.     {
  103.         new szSteamID[36], szIP[16]
  104.         get_user_authid(id, szSteamID, charsmax(szSteamID))
  105.         get_user_ip(id, szIP, charsmax(szIP), 1)
  106.         Log_Messages("[%s|%s] %s", szSteamID, szIP, szMessage)
  107.     }
  108.    
  109.     return PLUGIN_CONTINUE
  110. }
  111.  
  112. public Hook_SayTeam(id)
  113. {  
  114.     if (!is_user_connected(id))
  115.         return PLUGIN_CONTINUE
  116.        
  117.     new szName[32], szMessage[200], szTeamName[32], szPrefixes[64], iLevelNum
  118.     get_user_name(id, szName, charsmax(szName))
  119.     iLevelNum = ze_get_user_level(id)
  120.     read_args(szMessage, charsmax(szMessage))
  121.     remove_quotes(szMessage)
  122.     trim(szMessage)
  123.  
  124.     for(new iChar = 0; iChar <= charsmax(szMessage); iChar++)
  125.     {
  126.         if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4')
  127.             szMessage[iChar] = '^1'
  128.     }
  129.  
  130.     if (!is_valid_msg(szMessage))
  131.         return PLUGIN_CONTINUE
  132.  
  133.     // Team check
  134.     switch(get_member(id, m_iTeam))
  135.     {
  136.         case TEAM_CT: formatex(szTeamName, charsmax(szTeamName), szCT_Prefix)
  137.         case TEAM_TERRORIST: formatex(szTeamName, charsmax(szTeamName), szT_Prefix)
  138.         case TEAM_SPECTATOR: formatex(szTeamName, charsmax(szTeamName), szSpecT_Prefix)
  139.     }
  140.  
  141.     LookUPPrefixes(id)
  142.  
  143.     // Prefixes check
  144.     if (strlen(g_szPrefixPrefixes))
  145.         formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum)
  146.     else
  147.         formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum)
  148.  
  149.     // Message foramt
  150.     if(is_user_alive(id))
  151.         format(szMessage, charsmax(szMessage), "^1(%s^1) [%s^1] ^3%s ^1: ^1%s", szTeamName, szPrefixes, szName, szMessage)
  152.     else
  153.         format(szMessage, charsmax(szMessage), "^1(%s^1) [%s ^1| %s^1] ^3%s ^1: ^1%s", szTeamName, szDead_Prefix, szPrefixes, szName, szMessage)
  154.  
  155.     // Send the message
  156.     for (new i = 1; i <= g_iMaxPlayers; i++)
  157.     {
  158.         if(!is_user_connected(i) || get_user_team(i) != get_user_team(id))
  159.             continue
  160.  
  161.         Send_Message(szMessage, id, i)
  162.     }
  163.  
  164.     // Log messages
  165.     if (get_pcvar_num(g_pCvarLogMessages))
  166.     {
  167.         new szSteamID[36], szIP[16]
  168.         get_user_authid(id, szSteamID, charsmax(szSteamID))
  169.         get_user_ip(id, szIP, charsmax(szIP), 1)
  170.         Log_Messages("[%s|%s] - %s", szSteamID, szIP, szMessage)
  171.     }
  172.    
  173.     return PLUGIN_CONTINUE
  174. }
  175.  
  176. bool:is_valid_msg(const szMessage[])
  177. {
  178.     if (szMessage[0] == '@' || !strlen(szMessage) || szMessage[0] == '/' || szMessage[0] == '#')
  179.         return false
  180.        
  181.     return true
  182. }
  183.  
  184. stock Log_Messages(const szMessage_Fmt[], any:...)
  185. {
  186.     static szMessage[256], szFileName[32], szDate[16]
  187.     vformat(szMessage, charsmax(szMessage), szMessage_Fmt, 2)
  188.     replace_all(szMessage, charsmax(szMessage), "^4", "")
  189.     replace_all(szMessage, charsmax(szMessage), "^1", "")
  190.     replace_all(szMessage, charsmax(szMessage), "^1", "")
  191.     replace_all(szMessage, charsmax(szMessage), "^3", "")
  192.     format_time(szDate, charsmax(szDate), "%d%m%Y")
  193.     formatex(szFileName, charsmax(szFileName), "ZE_Messages_%s.log", szDate)
  194.     log_to_file(szFileName, "%s", szMessage)
  195. }
  196.  
  197. stock Send_Message(const szMessage[], const id, const iIndex)
  198. {
  199.     message_begin(MSG_ONE, g_iSayText, {0, 0, 0}, iIndex)
  200.     write_byte(id)
  201.     write_string(szMessage)
  202.     message_end()
  203. }
  204.  
  205. public ReadLines()
  206. {
  207.     if (file_exists(g_szFile))
  208.     {
  209.         new OpennedFile = fopen(g_szFile, "rt"),
  210.             szLineToRead[129], szPrefixFlags[32], szPrefixPrefix[32]
  211.  
  212.         if (!OpennedFile)
  213.             return
  214.        
  215.         while (!feof(OpennedFile))
  216.         {
  217.             fgets(OpennedFile, szLineToRead, charsmax(szLineToRead))
  218.  
  219.             if ((szLineToRead[0] == '/' && szLineToRead[1] == '/'))
  220.                 continue
  221.  
  222.             for (new iIndex = 0; iIndex <= charsmax(g_szReservedChars); iIndex++)
  223.             {
  224.                 if (equal(szLineToRead[0], g_szReservedChars[iIndex]))
  225.                     continue
  226.             }
  227.            
  228.             remove_quotes(szLineToRead)
  229.             trim(szLineToRead)
  230.             parse(szLineToRead, szPrefixPrefix, charsmax(szPrefixPrefix), szPrefixFlags, charsmax(szPrefixFlags))
  231.             ArrayPushString(g_szPrefixes, szPrefixPrefix)
  232.             ArrayPushString(g_szFlags, szPrefixFlags)
  233.         }
  234.        
  235.         fclose(OpennedFile)
  236.     }
  237.     else
  238.     {
  239.         set_fail_state("File %s is not found.", g_szFile)
  240.     }
  241. }
  242.  
  243. public LookUPPrefixes(id)
  244. {
  245.     ReadLines()
  246.  
  247.     new szPrefixFlags[32], iIndex, szPrefixPrefix[32]
  248.     for (iIndex = 0; iIndex < ArraySize(g_szFlags); iIndex++)
  249.     {
  250.         ArrayGetString(g_szFlags, iIndex, szPrefixFlags, charsmax(szPrefixFlags))
  251.  
  252.         if (access(id, read_flags(szPrefixFlags)))
  253.         {
  254.             ArrayGetString(g_szPrefixes, iIndex, szPrefixPrefix, charsmax(szPrefixPrefix))
  255.             copy(g_szPrefixPrefixes, charsmax(g_szPrefixPrefixes), szPrefixPrefix)
  256.             break
  257.         }
  258.     }
  259. }
Because don't i have to set them up in users.ini for them to get the flag think it was T.

I want to be able to not setup in 2 places. If im wrong let me know.

Also the code you posted up above is the same in the rar file not the one that works that you posted the amxx file for.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#55

Post by Spir0x » 5 years ago

Yes like RapidFlush said. i tested your code jack it never shows admin prefix only levels like in the rar file.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#56

Post by Spir0x » 5 years ago

So ?!

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#57

Post by Night Fury » 5 years ago

Spir0x wrote: 5 years ago Yes like RapidFlush said. i tested your code jack it never shows admin prefix only levels like in the rar file.
I've updated the rar with the working code.
It should be fixed now.
RapidFlush wrote: 5 years ago
Because don't i have to set them up in users.ini for them to get the flag think it was T.

I want to be able to not setup in 2 places. If im wrong let me know.

Also the code you posted up above is the same in the rar file not the one that works that you posted the amxx file for.
You can do that:
  1. Open vips.ini.
  2. Loop through all connected players & get their names & authids.
  3. Compare them with the registered VIP names/authids & check if they are already VIP or not.
  4. If they are, put them the prefix you want otherwise ignore.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#58

Post by Rain1153 » 5 years ago

jack what's the path for message logs?
LOL

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#59

Post by Night Fury » 5 years ago

Rain1153 wrote: 5 years ago jack what's the path for message logs?
You will find the log file in addons/amxmodx/logs.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

shady101852
Member
Member
United States of America
Posts: 27
Joined: 5 years ago
Contact:

#60

Post by shady101852 » 5 years ago

is there a version of this without the levels? I only wanted it for the [human] / [zombie] tag since I don't use the levels system. Also how would we make it detect the flag VIP_A and get the prefix [VIP] for vip players? (instead of adding a prefix for each vip manually)

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#61

Post by Spir0x » 5 years ago

Yes good idea @shady

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#62

Post by johnnysins2000 » 1 year ago

Night Fury wrote: 6 years ago
Chat Prefix

| Description:

This plugin will add a custom prefix before every player's message.


| Cvars:
  • Enable message logging?

    Code: Select all

    ze_log_messages

| Prefix names:
  • You can change CT team prefix name from this line:

    Code: Select all

    new const szCTName[] = "Humans"
  • You can change T team prefix name from this line:

    Code: Select all

    new const szTName[] = "Zombies"
  • You can change SPEC team prefix name from this line:

    Code: Select all

    new const szSpecTName[] = "Spectators"
  • You can change dead prefix name from this line:

    Code: Select all

    new const szDeadName[] = "Dead"
  • You can change level prefix name from this line:

    Code: Select all

    new const szLevelName[] = "Level"

| Notes:
  1. This plugin will not work unless the .ini file was found.
  2. There are 3 colors:
    1. ^1 => Yellow.
    2. ^4 => Green.
    3. ^3 => Team color => blue for CT, red for T, white/gray for Spec.
    • Edit the custom prefixes file's name from here:

      Code: Select all

      new const ZE_CUSTOMPREFIX[] = "ze_customprefix"
  3. You can comment a line in the .ini file by adding at the begging of the line any of the characaters in g_szReservedChars Array.

| Changelog:
  • Spoiler!

    Image
    • First stable release.
    Image
    1. Minor bug fixes.
    2. Added VIP prefix.
    3. Added Level prefix.
    4. Update code style.
    5. Green message for VIPs.
    6. Fixed "say_team" messages.
    Image
    • Minor bug fixes.
    Image [Current Version]
    • Minor bug fixes.
    • Added custom prefixes file.
    • Replace class prefixes with a name & message team color.
    • Updated code style.
    • Plugin optimizated.

| Download:
  • Chat prefix.rar
Is it possible to convert it and use it for normals mods too?
Nobody Is That Busy If They Make Time :roll:

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests