Chat Prefix
go to ur cstrike/addons/amxmodx/configs and search for ze_customprefix.ini and edit accordingly as jack said
LOL
-
- Veteran Member
- Posts: 598
- Joined: 7 years ago
- Contact:
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"
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
Try this AMXX file.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"
What about admin prefix chat colors ? i can change "Owner" to "^4[^1Owner^4]" ? or no.
Okey thanks.
Raheem bro please can you help me here on this plugin i want to remove the Teams prefix " [Zombie] [Human] [Spectator]" I just want in this plugin Levels prefix and admins prefix like: [Admin] [Level 15] Spi: Hello all ! can you do it ?
Just cuz Theres many words in chat [Admin] [Zombie] [Level 15] i want to remove it i see it useless
Just cuz Theres many words in chat [Admin] [Zombie] [Level 15] i want to remove it i see it useless
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
Have you checked the changelog?!Spir0x wrote: ↑5 years ago Raheem bro please can you help me here on this plugin i want to remove the Teams prefix " [Zombie] [Human] [Spectator]" I just want in this plugin Levels prefix and admins prefix like: [Admin] [Level 15] Spi: Hello all ! can you do it ?
Just cuz Theres many words in chat [Admin] [Zombie] [Level 15] i want to remove it i see it useless
Okey what about this cvar "ze_log_messages" it's for what exactly ?
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
Next time, take 1 min from your 24 hours & read the full topic because i won't reply to such a question like this.Enable message logging?
Where the sma for this amxx file?Jack GamePlay wrote: ↑5 years agoTry this AMXX file.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"
Also
How can i set it to read from vip.ini so if someone has vip if will give them that tag?
Jack please give me the SMA file !! you're sma one in the rar showing only levels without the other prefixes.Jack GamePlay wrote: ↑5 years agoTry this AMXX file.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"
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
Why do you want to do this?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?
You can already set a default VIP flag in ze_customprefixes & make that's prefix VIP.
Here you both the code.
Try it.
- #include <zombie_escape>
- #include <ze_levels>
- // Custom prefixes file
- new const ZE_CUSTOMPREFIX[] = "ze_customprefix"
- // Edit each prefix class here
- /* There are 3 colors:
- * ^1 => Yellow
- * ^4 => Green
- * ^3 => Team color => blue for CT, red for T, white/gray for Spec
- */
- new const szCT_Prefix[] = "^3Humans"
- new const szT_Prefix[] = "^3Zombies"
- new const szSpecT_Prefix[] = "^3Spectators"
- new const szDead_Prefix[] = "^4Dead"
- new const szLevel_Prefix[] = "^4Level"
- new g_szPrefixPrefixes[32], g_szFile[64]
- new g_iMaxPlayers, g_iSayText
- new g_pCvarLogMessages
- new Array:g_szPrefixes, Array:g_szFlags
- new const g_szReservedChars[] = {
- ';', '$', '#', '*', '!',
- '@', '%', '&', '(', ')',
- '[', ']', '>', '<', EOS
- }
- public plugin_init()
- {
- register_plugin("[ZE] Addons: Prefixes", "1.3", "Jack GamePlay")
- register_clcmd("say", "Hook_Say")
- register_clcmd("say_team", "Hook_SayTeam")
- g_pCvarLogMessages = register_cvar("ze_log_messages", "0")
- g_iMaxPlayers = get_member_game(m_nMaxPlayers)
- g_iSayText = get_user_msgid("SayText")
- register_message(g_iSayText, "BlockDoubleMessages")
- get_configsdir(g_szFile, charsmax(g_szFile))
- formatex(g_szFile, charsmax(g_szFile), "%s/%s.ini", g_szFile, ZE_CUSTOMPREFIX)
- g_szPrefixes = ArrayCreate(32, 1)
- g_szFlags = ArrayCreate(32, 1)
- }
- public BlockDoubleMessages()
- {
- return PLUGIN_HANDLED
- }
- public Hook_Say(id)
- {
- if (!is_user_connected(id))
- return PLUGIN_CONTINUE
- new szName[32], iLevelNum, szMessage[200], szPrefixes[64]
- get_user_name(id, szName, charsmax(szName))
- iLevelNum = ze_get_user_level(id)
- read_args(szMessage, charsmax(szMessage))
- remove_quotes(szMessage)
- trim(szMessage)
- for(new iChar = 0; iChar <= charsmax(szMessage); iChar++)
- {
- if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4')
- szMessage[iChar] = '^1'
- }
- if (!is_valid_msg(szMessage))
- return PLUGIN_CONTINUE
- LookUPPrefixes(id)
- if (strlen(g_szPrefixPrefixes))
- formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum)
- else
- formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum)
- // Message format
- if (is_user_alive(id))
- format(szMessage, charsmax(szMessage), "^1[%s^1] ^3%s ^1: ^1%s", szPrefixes, szName, szMessage)
- else
- format(szMessage, charsmax(szMessage), "^1[%s ^1| %s^1] ^3%s ^1: ^1%s", szDead_Prefix, szPrefixes, szName, szMessage)
- // Send the message
- for (new i = 1; i <= g_iMaxPlayers; i++)
- {
- if (!is_user_connected(i))
- continue
- Send_Message(szMessage, id, i)
- }
- // Log messages
- if (get_pcvar_num(g_pCvarLogMessages))
- {
- new szSteamID[36], szIP[16]
- get_user_authid(id, szSteamID, charsmax(szSteamID))
- get_user_ip(id, szIP, charsmax(szIP), 1)
- Log_Messages("[%s|%s] %s", szSteamID, szIP, szMessage)
- }
- return PLUGIN_CONTINUE
- }
- public Hook_SayTeam(id)
- {
- if (!is_user_connected(id))
- return PLUGIN_CONTINUE
- new szName[32], szMessage[200], szTeamName[32], szPrefixes[64], iLevelNum
- get_user_name(id, szName, charsmax(szName))
- iLevelNum = ze_get_user_level(id)
- read_args(szMessage, charsmax(szMessage))
- remove_quotes(szMessage)
- trim(szMessage)
- for(new iChar = 0; iChar <= charsmax(szMessage); iChar++)
- {
- if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4')
- szMessage[iChar] = '^1'
- }
- if (!is_valid_msg(szMessage))
- return PLUGIN_CONTINUE
- // Team check
- switch(get_member(id, m_iTeam))
- {
- case TEAM_CT: formatex(szTeamName, charsmax(szTeamName), szCT_Prefix)
- case TEAM_TERRORIST: formatex(szTeamName, charsmax(szTeamName), szT_Prefix)
- case TEAM_SPECTATOR: formatex(szTeamName, charsmax(szTeamName), szSpecT_Prefix)
- }
- LookUPPrefixes(id)
- // Prefixes check
- if (strlen(g_szPrefixPrefixes))
- formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum)
- else
- formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum)
- // Message foramt
- if(is_user_alive(id))
- format(szMessage, charsmax(szMessage), "^1(%s^1) [%s^1] ^3%s ^1: ^1%s", szTeamName, szPrefixes, szName, szMessage)
- else
- format(szMessage, charsmax(szMessage), "^1(%s^1) [%s ^1| %s^1] ^3%s ^1: ^1%s", szTeamName, szDead_Prefix, szPrefixes, szName, szMessage)
- // Send the message
- for (new i = 1; i <= g_iMaxPlayers; i++)
- {
- if(!is_user_connected(i) || get_user_team(i) != get_user_team(id))
- continue
- Send_Message(szMessage, id, i)
- }
- // Log messages
- if (get_pcvar_num(g_pCvarLogMessages))
- {
- new szSteamID[36], szIP[16]
- get_user_authid(id, szSteamID, charsmax(szSteamID))
- get_user_ip(id, szIP, charsmax(szIP), 1)
- Log_Messages("[%s|%s] - %s", szSteamID, szIP, szMessage)
- }
- return PLUGIN_CONTINUE
- }
- bool:is_valid_msg(const szMessage[])
- {
- if (szMessage[0] == '@' || !strlen(szMessage) || szMessage[0] == '/' || szMessage[0] == '#')
- return false
- return true
- }
- stock Log_Messages(const szMessage_Fmt[], any:...)
- {
- static szMessage[256], szFileName[32], szDate[16]
- vformat(szMessage, charsmax(szMessage), szMessage_Fmt, 2)
- replace_all(szMessage, charsmax(szMessage), "^4", "")
- replace_all(szMessage, charsmax(szMessage), "^1", "")
- replace_all(szMessage, charsmax(szMessage), "^1", "")
- replace_all(szMessage, charsmax(szMessage), "^3", "")
- format_time(szDate, charsmax(szDate), "%d%m%Y")
- formatex(szFileName, charsmax(szFileName), "ZE_Messages_%s.log", szDate)
- log_to_file(szFileName, "%s", szMessage)
- }
- stock Send_Message(const szMessage[], const id, const iIndex)
- {
- message_begin(MSG_ONE, g_iSayText, {0, 0, 0}, iIndex)
- write_byte(id)
- write_string(szMessage)
- message_end()
- }
- public ReadLines()
- {
- if (file_exists(g_szFile))
- {
- new OpennedFile = fopen(g_szFile, "rt"),
- szLineToRead[129], szPrefixFlags[32], szPrefixPrefix[32]
- if (!OpennedFile)
- return
- while (!feof(OpennedFile))
- {
- fgets(OpennedFile, szLineToRead, charsmax(szLineToRead))
- if ((szLineToRead[0] == '/' && szLineToRead[1] == '/'))
- continue
- for (new iIndex = 0; iIndex <= charsmax(g_szReservedChars); iIndex++)
- {
- if (equal(szLineToRead[0], g_szReservedChars[iIndex]))
- continue
- }
- remove_quotes(szLineToRead)
- trim(szLineToRead)
- parse(szLineToRead, szPrefixPrefix, charsmax(szPrefixPrefix), szPrefixFlags, charsmax(szPrefixFlags))
- ArrayPushString(g_szPrefixes, szPrefixPrefix)
- ArrayPushString(g_szFlags, szPrefixFlags)
- }
- fclose(OpennedFile)
- }
- else
- {
- set_fail_state("File %s is not found.", g_szFile)
- }
- }
- public LookUPPrefixes(id)
- {
- ReadLines()
- new szPrefixFlags[32], iIndex, szPrefixPrefix[32]
- for (iIndex = 0; iIndex < ArraySize(g_szFlags); iIndex++)
- {
- ArrayGetString(g_szFlags, iIndex, szPrefixFlags, charsmax(szPrefixFlags))
- if (access(id, read_flags(szPrefixFlags)))
- {
- ArrayGetString(g_szPrefixes, iIndex, szPrefixPrefix, charsmax(szPrefixPrefix))
- copy(g_szPrefixPrefixes, charsmax(g_szPrefixPrefixes), szPrefixPrefix)
- break
- }
- }
- }
Because don't i have to set them up in users.ini for them to get the flag think it was T.Jack GamePlay wrote: ↑5 years agoWhy do you want to do this?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?
You can already set a default VIP flag in ze_customprefixes & make that's prefix VIP.
Here you both the code.
Try it.
#include <zombie_escape> #include <ze_levels> // Custom prefixes file new const ZE_CUSTOMPREFIX[] = "ze_customprefix" // Edit each prefix class here /* There are 3 colors: * ^1 => Yellow * ^4 => Green * ^3 => Team color => blue for CT, red for T, white/gray for Spec */ new const szCT_Prefix[] = "^3Humans" new const szT_Prefix[] = "^3Zombies" new const szSpecT_Prefix[] = "^3Spectators" new const szDead_Prefix[] = "^4Dead" new const szLevel_Prefix[] = "^4Level" new g_szPrefixPrefixes[32], g_szFile[64] new g_iMaxPlayers, g_iSayText new g_pCvarLogMessages new Array:g_szPrefixes, Array:g_szFlags new const g_szReservedChars[] = { ';', '$', '#', '*', '!', '@', '%', '&', '(', ')', '[', ']', '>', '<', EOS } public plugin_init() { register_plugin("[ZE] Addons: Prefixes", "1.3", "Jack GamePlay") register_clcmd("say", "Hook_Say") register_clcmd("say_team", "Hook_SayTeam") g_pCvarLogMessages = register_cvar("ze_log_messages", "0") g_iMaxPlayers = get_member_game(m_nMaxPlayers) g_iSayText = get_user_msgid("SayText") register_message(g_iSayText, "BlockDoubleMessages") get_configsdir(g_szFile, charsmax(g_szFile)) formatex(g_szFile, charsmax(g_szFile), "%s/%s.ini", g_szFile, ZE_CUSTOMPREFIX) g_szPrefixes = ArrayCreate(32, 1) g_szFlags = ArrayCreate(32, 1) } public BlockDoubleMessages() { return PLUGIN_HANDLED } public Hook_Say(id) { if (!is_user_connected(id)) return PLUGIN_CONTINUE new szName[32], iLevelNum, szMessage[200], szPrefixes[64] get_user_name(id, szName, charsmax(szName)) iLevelNum = ze_get_user_level(id) read_args(szMessage, charsmax(szMessage)) remove_quotes(szMessage) trim(szMessage) for(new iChar = 0; iChar <= charsmax(szMessage); iChar++) { if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4') szMessage[iChar] = '^1' } if (!is_valid_msg(szMessage)) return PLUGIN_CONTINUE LookUPPrefixes(id) if (strlen(g_szPrefixPrefixes)) formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum) else formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum) // Message format if (is_user_alive(id)) format(szMessage, charsmax(szMessage), "^1[%s^1] ^3%s ^1: ^1%s", szPrefixes, szName, szMessage) else format(szMessage, charsmax(szMessage), "^1[%s ^1| %s^1] ^3%s ^1: ^1%s", szDead_Prefix, szPrefixes, szName, szMessage) // Send the message for (new i = 1; i <= g_iMaxPlayers; i++) { if (!is_user_connected(i)) continue Send_Message(szMessage, id, i) } // Log messages if (get_pcvar_num(g_pCvarLogMessages)) { new szSteamID[36], szIP[16] get_user_authid(id, szSteamID, charsmax(szSteamID)) get_user_ip(id, szIP, charsmax(szIP), 1) Log_Messages("[%s|%s] %s", szSteamID, szIP, szMessage) } return PLUGIN_CONTINUE } public Hook_SayTeam(id) { if (!is_user_connected(id)) return PLUGIN_CONTINUE new szName[32], szMessage[200], szTeamName[32], szPrefixes[64], iLevelNum get_user_name(id, szName, charsmax(szName)) iLevelNum = ze_get_user_level(id) read_args(szMessage, charsmax(szMessage)) remove_quotes(szMessage) trim(szMessage) for(new iChar = 0; iChar <= charsmax(szMessage); iChar++) { if (szMessage[iChar] == '^2' || szMessage[iChar] == '^3' || szMessage[iChar] == '^4') szMessage[iChar] = '^1' } if (!is_valid_msg(szMessage)) return PLUGIN_CONTINUE // Team check switch(get_member(id, m_iTeam)) { case TEAM_CT: formatex(szTeamName, charsmax(szTeamName), szCT_Prefix) case TEAM_TERRORIST: formatex(szTeamName, charsmax(szTeamName), szT_Prefix) case TEAM_SPECTATOR: formatex(szTeamName, charsmax(szTeamName), szSpecT_Prefix) } LookUPPrefixes(id) // Prefixes check if (strlen(g_szPrefixPrefixes)) formatex(szPrefixes, charsmax(szPrefixes), "^4%s ^1| %s^1: ^3%i", g_szPrefixPrefixes, szLevel_Prefix, iLevelNum) else formatex(szPrefixes, charsmax(szPrefixes), "%s^1: ^3%i", szLevel_Prefix, iLevelNum) // Message foramt if(is_user_alive(id)) format(szMessage, charsmax(szMessage), "^1(%s^1) [%s^1] ^3%s ^1: ^1%s", szTeamName, szPrefixes, szName, szMessage) else format(szMessage, charsmax(szMessage), "^1(%s^1) [%s ^1| %s^1] ^3%s ^1: ^1%s", szTeamName, szDead_Prefix, szPrefixes, szName, szMessage) // Send the message for (new i = 1; i <= g_iMaxPlayers; i++) { if(!is_user_connected(i) || get_user_team(i) != get_user_team(id)) continue Send_Message(szMessage, id, i) } // Log messages if (get_pcvar_num(g_pCvarLogMessages)) { new szSteamID[36], szIP[16] get_user_authid(id, szSteamID, charsmax(szSteamID)) get_user_ip(id, szIP, charsmax(szIP), 1) Log_Messages("[%s|%s] - %s", szSteamID, szIP, szMessage) } return PLUGIN_CONTINUE } bool:is_valid_msg(const szMessage[]) { if (szMessage[0] == '@' || !strlen(szMessage) || szMessage[0] == '/' || szMessage[0] == '#') return false return true } stock Log_Messages(const szMessage_Fmt[], any:...) { static szMessage[256], szFileName[32], szDate[16] vformat(szMessage, charsmax(szMessage), szMessage_Fmt, 2) replace_all(szMessage, charsmax(szMessage), "^4", "") replace_all(szMessage, charsmax(szMessage), "^1", "") replace_all(szMessage, charsmax(szMessage), "^1", "") replace_all(szMessage, charsmax(szMessage), "^3", "") format_time(szDate, charsmax(szDate), "%d%m%Y") formatex(szFileName, charsmax(szFileName), "ZE_Messages_%s.log", szDate) log_to_file(szFileName, "%s", szMessage) } stock Send_Message(const szMessage[], const id, const iIndex) { message_begin(MSG_ONE, g_iSayText, {0, 0, 0}, iIndex) write_byte(id) write_string(szMessage) message_end() } public ReadLines() { if (file_exists(g_szFile)) { new OpennedFile = fopen(g_szFile, "rt"), szLineToRead[129], szPrefixFlags[32], szPrefixPrefix[32] if (!OpennedFile) return while (!feof(OpennedFile)) { fgets(OpennedFile, szLineToRead, charsmax(szLineToRead)) if ((szLineToRead[0] == '/' && szLineToRead[1] == '/')) continue for (new iIndex = 0; iIndex <= charsmax(g_szReservedChars); iIndex++) { if (equal(szLineToRead[0], g_szReservedChars[iIndex])) continue } remove_quotes(szLineToRead) trim(szLineToRead) parse(szLineToRead, szPrefixPrefix, charsmax(szPrefixPrefix), szPrefixFlags, charsmax(szPrefixFlags)) ArrayPushString(g_szPrefixes, szPrefixPrefix) ArrayPushString(g_szFlags, szPrefixFlags) } fclose(OpennedFile) } else { set_fail_state("File %s is not found.", g_szFile) } } public LookUPPrefixes(id) { ReadLines() new szPrefixFlags[32], iIndex, szPrefixPrefix[32] for (iIndex = 0; iIndex < ArraySize(g_szFlags); iIndex++) { ArrayGetString(g_szFlags, iIndex, szPrefixFlags, charsmax(szPrefixFlags)) if (access(id, read_flags(szPrefixFlags))) { ArrayGetString(g_szPrefixes, iIndex, szPrefixPrefix, charsmax(szPrefixPrefix)) copy(g_szPrefixPrefixes, charsmax(g_szPrefixPrefixes), szPrefixPrefix) break } } }
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.
Yes like RapidFlush said. i tested your code jack it never shows admin prefix only levels like in the rar file.
So ?!
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
I've updated the rar with the working code.
It should be fixed now.
You can do that: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.
- Open vips.ini.
- Loop through all connected players & get their names & authids.
- Compare them with the registered VIP names/authids & check if they are already VIP or not.
- If they are, put them the prefix you want otherwise ignore.
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
You will find the log file in addons/amxmodx/logs.
-
- Member
- Posts: 27
- Joined: 5 years ago
- Contact:
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)
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
Sign in
Who is online
Users browsing this forum: No registered users and 0 guests