User
Pass
2FA
 
 

Cerere plugin adminchat
Go to page Previous  1, 2, 3  Next    
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message6541
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 30-04-2017, 10:26:23 | Translate post to: ... (Click for more languages)

Amandoua acelasi rezultat... Tot asa e..
0 0
  
Back to top
View user's profile Send private message
GoreSpintecatoru.

[Inactiv o perioada]



Status: Offline
(since 09-11-2017 19:29)
Joined: 18 Feb 2017
Posts: 638, Topics: 28
Location: Romania

Reputation: 762.7
Votes: 40

       
Post Posted: 30-04-2017, 20:02:59 | Translate post to: ... (Click for more languages)

Code:
/* AMX Mod X
* Admin Chat Plugin
*
* by the AMX Mod X Development Team
* originally developed by OLO
*
* This file is part of AMX Mod X.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/

#include <amxmodx>
#include <amxmisc>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}

new amx_show_activity, amx_namegreen;

new g_msgSayText

public plugin_init()
{
register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("adminchatgreen.txt")
register_dictionary("common.txt")
register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")

amx_show_activity = get_cvar_pointer("amx_show_activity");

if (amx_show_activity == 0)
{
amx_show_activity = register_cvar("amx_show_activity", "2");
}

amx_namegreen = register_cvar("amx_namegreen", "0");
g_msgSayText = get_user_msgid("SayText");
}

public cmdSayChat(id)
{
if (!access(id, ADMIN_CHAT))
{
return PLUGIN_CONTINUE
}

new said[6], i = 0
read_argv(1, said, 5)

while (said[i] == '@')
{
i++
}

new message[192], name[32]
read_args(message, 191)
get_user_name(id, name, 31)
remove_quotes(message)
if (!i || i > 3)
{
if(!(get_pcvar_num(amx_namegreen)) ) return PLUGIN_CONTINUE
new players[32], inum, player
get_players(players, inum)
if(is_user_alive(id))
format(message, 191, "^4%s^3:^1%s", name, message)
else
format(message, 191, "^1*DEAD*^4%s ^3:^1%s", name, message)
for(new j = 0; j < inum; ++j) {
player = players[j]
ColorChat(player, id, message)
}
return PLUGIN_HANDLED_MAIN
}

new a = 0
switch (said[i])
{
case 'r': a = 1
case 'g': a = 2
case 'b': a = 3
case 'y': a = 4
case 'm': a = 5
case 'c': a = 6
case 'o': a = 7
}

new n, s = i
if (a)
{
n++
s++
}
while (said[s] && isspace(said[s]))
{
n++
s++
}


new authid[32], userid

get_user_authid(id, authid, 31)
userid = get_user_userid(id)

log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])

if (++g_msgChannel > 6 || g_msgChannel < 3)
{
g_msgChannel = 3
}

new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0

set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message[i + n])
client_print(pl, print_notify, "%s : %s", name, message[i + n])
}
else
{
show_hudmessage(pl, "%s", message[i + n])
client_print(pl, print_notify, "%s", message[i + n])
}
}
}
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message[i + n])
client_print(0, print_notify, "%s : %s", name, message[i + n])
}
default:
{
show_hudmessage(0, "%s", message[i + n])
client_print(0, print_notify, "%s", message[i + n])
}
}
if(a==1) {
client_cmd(0, "spk ^"vox/warning _comma message from administration^"")
}

return PLUGIN_HANDLED
}

public cmdSayAdmin(id)
{
new said[2]
read_argv(1, said, 1)

if (said[0] != '@')
return PLUGIN_CONTINUE

new message[192], name[32], authid[32], userid
new players[32], inum, player

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)

log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])

if (is_user_admin(id))
format(message, 191, "^4(%L) ^3%s ^4: ^1%s", id, "ADMIN", name, message[1])
else
format(message, 191, "^4(%L) ^3%s ^4: ^1%s", id, "PLAYER", name, message[1])

get_players(players, inum)

for (new i = 0; i < inum; ++i)
{
player = players[i]
if (get_user_flags(player) & ADMIN_CHAT || player == id)
{
ColorChat(player, id, message)
}
}   
return PLUGIN_HANDLED
}

public cmdChat(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new message[192], name[32], players[32], inum, authid[32], userid, player

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
get_players(players, inum)

log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)

format(message, 191, "^4(ADMINS) ^3%s ^4: ^1%s", name, message)
console_print(id, "%s", message)

for (new i = 0; i < inum; ++i)
{
player = players[i]
if (access(players[i], ADMIN_CHAT))
{
ColorChat(player, id, message)
}
}
return PLUGIN_HANDLED
}

public cmdSay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new message[192], name[32], authid[32], userid

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)

console_print(id, "%L", id, "PRINT_ALL", name, message)

log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)

new colored[192]


new players[32], inum, player
get_players(players, inum)

for (new i = 0; i < inum; i++)
{
player = players[i]
switch(get_pcvar_num(amx_show_activity))
{
case 3, 4:
{
if(is_user_admin(player)){
formatex(colored,191,"^1(%L) ^4 ADMIN ^3%s ^1: %s", player, "ALL", name, message)
}else{
formatex(colored,191,"^1(%L) ^4 ADMIN ^1: %s", player, "ALL", message)
}
}
case 2:formatex(colored,191,"^1(%L) ^4 ADMIN ^3%s ^1: %s", player, "ALL", name, message)
default :formatex(colored,191,"^1(%L) ^4 ADMIN ^1: %s", player, "ALL", message)
}
ColorChat(player, id, colored)
}
return PLUGIN_HANDLED
}

public cmdPsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new name[32]
read_argv(1, name, 31)
new priv = cmd_target(id, name, 0)

if (!priv)
return PLUGIN_HANDLED

new length = strlen(name) + 1

get_user_name(priv, name, 31);

new message[192], name2[32], authid[32], authid2[32], userid, userid2

get_user_authid(id, authid, 31)
get_user_name(id, name2, 31)
userid = get_user_userid(id)
read_args(message, 191)

if (message[0] == '"' && message[length] == '"') // HLSW fix
{
message[0] = ' '
message[length] = ' '
length += 2
}

remove_quotes(message[length])
get_user_name(priv, name, 31)
new colored[192]
formatex(colored,191,"^1(^4%s^1) ^4%s ^1: %s", name, name2, message[length])
if (id && id != priv)
{
ColorChat(id, id, colored)
}
ColorChat(priv, id, colored)

console_print(id, "(%s) %s : %s", name, name2, message[length])
get_user_authid(priv, authid2, 31)
userid2 = get_user_userid(priv)

log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])

return PLUGIN_HANDLED
}

public cmdTsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0

read_argv(0, cmd, 15)
new bool:tsay = (tolower(cmd[4]) == 't')

read_args(message, 191)
remove_quotes(message)
parse(message, color, 15)

new found = 0, a = 0
new lang[3], langnum = get_langsnum()

for (new i = 0; i < MAX_CLR; ++i)
{
for (new j = 0; j < langnum; j++)
{
get_lang(j, lang)
format(color2, 15, "%L", lang, g_Colors[i])

if (equali(color, color2))
{
a = i
found = 1
break
}
}
if (found == 1)
break
}

new length = found ? (strlen(color) + 1) : 0

if (++g_msgChannel > 6 || g_msgChannel < 3)
g_msgChannel = 3

new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0

get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message[length])
client_print(pl, print_notify, "%s : %s", name, message[length])
}
else
{
show_hudmessage(pl, "%s", message[length])
client_print(pl, print_notify, "%s", message[length])
}
}
}
console_print(id, "%s : %s", name, message[length])
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message[length])
client_print(0, print_notify, "%s : %s", name, message[length])
console_print(id, "%s : %s", name, message[length])
}
default:
{
show_hudmessage(0, "%s", message[length])
client_print(0, print_notify, "%s", message[length])
console_print(id, "%s", message[length])
}
}

if(a==1) {
client_cmd(0, "spk ^"vox/warning _period message from administration^"")
}

log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)

return PLUGIN_HANDLED
}

ColorChat(id, iSender, fmt[], any:...)
{
new szMsg[192]
szMsg[0] = 0x04
vformat(szMsg[1], charsmax(szMsg)-1, fmt, 4)

if( !iSender )
{
iSender = 1
}

message_begin(id ?MSG_ONE:MSG_ALL, g_msgSayText, _, id)
{
write_byte(iSender)
write_string(szMsg)
}
message_end()
}


Regulament|My Official Website[V:1.1]|Panel JB[V:1.0]

0 0
  
Back to top
View user's profile Send private message
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 01-05-2017, 00:40:32 | Translate post to: ... (Click for more languages)

Nu..
0 0
  
Back to top
View user's profile Send private message
GoreSpintecatoru.

[Inactiv o perioada]



Status: Offline
(since 09-11-2017 19:29)
Joined: 18 Feb 2017
Posts: 638, Topics: 28
Location: Romania

Reputation: 762.7
Votes: 40

       
Post Posted: 01-05-2017, 09:39:13 | Translate post to: ... (Click for more languages)

Code:
/* AMX Mod X
* Admin Chat Plugin
*
* by the AMX Mod X Development Team
* originally developed by OLO
*
* This file is part of AMX Mod X.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/

#include <amxmodx>
#include <amxmisc>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}

new amx_show_activity, amx_namegreen;

new g_msgSayText

public plugin_init()
{
register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("adminchatgreen.txt")
register_dictionary("common.txt")
register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")

amx_show_activity = get_cvar_pointer("amx_show_activity");

if (amx_show_activity == 0)
{
amx_show_activity = register_cvar("amx_show_activity", "2");
}

amx_namegreen = register_cvar("amx_namegreen", "0");
g_msgSayText = get_user_msgid("SayText");
}

public cmdSayChat(id)
{
if (!access(id, ADMIN_CHAT))
{
return PLUGIN_CONTINUE
}

new said[6], i = 0
read_argv(1, said, 5)

while (said[i] == '@')
{
i++
}

new message[192], name[32]
read_args(message, 191)
get_user_name(id, name, 31)
remove_quotes(message)
if (!i || i > 3)
{
if(!(get_pcvar_num(amx_namegreen)) ) return PLUGIN_CONTINUE
new players[32], inum, player
get_players(players, inum)
if(is_user_alive(id))
format(message, 191, "^4%s^3:^1%s", name, message)
else
format(message, 191, "^1*DEAD* ^4%s ^3:^1%s", name, message)
for(new j = 0; j < inum; ++j) {
player = players[j]
ColorChat(player, id, message)
}
return PLUGIN_HANDLED_MAIN
}

new a = 0
switch (said[i])
{
case 'r': a = 1
case 'g': a = 2
case 'b': a = 3
case 'y': a = 4
case 'm': a = 5
case 'c': a = 6
case 'o': a = 7
}

new n, s = i
if (a)
{
n++
s++
}
while (said[s] && isspace(said[s]))
{
n++
s++
}


new authid[32], userid

get_user_authid(id, authid, 31)
userid = get_user_userid(id)

log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])

if (++g_msgChannel > 6 || g_msgChannel < 3)
{
g_msgChannel = 3
}

new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0

set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message[i + n])
client_print(pl, print_notify, "%s : %s", name, message[i + n])
}
else
{
show_hudmessage(pl, "%s", message[i + n])
client_print(pl, print_notify, "%s", message[i + n])
}
}
}
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message[i + n])
client_print(0, print_notify, "%s : %s", name, message[i + n])
}
default:
{
show_hudmessage(0, "%s", message[i + n])
client_print(0, print_notify, "%s", message[i + n])
}
}
if(a==1) {
client_cmd(0, "spk ^"vox/warning _comma message from administration^"")
}

return PLUGIN_HANDLED
}

public cmdSayAdmin(id)
{
new said[2]
read_argv(1, said, 1)

if (said[0] != '@')
return PLUGIN_CONTINUE

new message[192], name[32], authid[32], userid
new players[32], inum, player

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)

log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])

if (is_user_admin(id))
format(message, 191, "^4(%L) ^3%s ^4: ^1%s", id, "ADMIN", name, message[1])
else
format(message, 191, "^4(%L) ^3%s ^4: ^1%s", id, "PLAYER", name, message[1])

get_players(players, inum)

for (new i = 0; i < inum; ++i)
{
player = players[i]
if (get_user_flags(player) & ADMIN_CHAT || player == id)
{
ColorChat(player, id, message)
}
}   
return PLUGIN_HANDLED
}

public cmdChat(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new message[192], name[32], players[32], inum, authid[32], userid, player

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
get_players(players, inum)

log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)

format(message, 191, "^4(ADMINS) ^3%s ^4: ^1%s", name, message)
console_print(id, "%s", message)

for (new i = 0; i < inum; ++i)
{
player = players[i]
if (access(players[i], ADMIN_CHAT))
{
ColorChat(player, id, message)
}
}
return PLUGIN_HANDLED
}

public cmdSay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED

new message[192], name[32], authid[32], userid

read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)

console_print(id, "%L", id, "PRINT_ALL", name, message)

log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)

new colored[192]


new players[32], inum, player
get_players(players, inum)

for (new i = 0; i < inum; i++)
{
player = players[i]
switch(get_pcvar_num(amx_show_activity))
{
case 3, 4:
{
if(is_user_admin(player)){
formatex(colored,191,"^1(%L) ^4 ADMIN ^3%s ^1: %s", player, "ALL", name, message)
}else{
formatex(colored,191,"^1(%L) ^4 ADMIN ^1: %s", player, "ALL", message)
}
}
case 2:formatex(colored,191,"^1(%L) ^4 ADMIN ^3%s ^1: %s", player, "ALL", name, message)
default :formatex(colored,191,"^1(%L) ^4 ADMIN ^1: %s", player, "ALL", message)
}
ColorChat(player, id, colored)
}
return PLUGIN_HANDLED
}

public cmdPsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new name[32]
read_argv(1, name, 31)
new priv = cmd_target(id, name, 0)

if (!priv)
return PLUGIN_HANDLED

new length = strlen(name) + 1

get_user_name(priv, name, 31);

new message[192], name2[32], authid[32], authid2[32], userid, userid2

get_user_authid(id, authid, 31)
get_user_name(id, name2, 31)
userid = get_user_userid(id)
read_args(message, 191)

if (message[0] == '"' && message[length] == '"') // HLSW fix
{
message[0] = ' '
message[length] = ' '
length += 2
}

remove_quotes(message[length])
get_user_name(priv, name, 31)
new colored[192]
formatex(colored,191,"^1(^4%s^1) ^4%s ^1: %s", name, name2, message[length])
if (id && id != priv)
{
ColorChat(id, id, colored)
}
ColorChat(priv, id, colored)

console_print(id, "(%s) %s : %s", name, name2, message[length])
get_user_authid(priv, authid2, 31)
userid2 = get_user_userid(priv)

log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])

return PLUGIN_HANDLED
}

public cmdTsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED

new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0

read_argv(0, cmd, 15)
new bool:tsay = (tolower(cmd[4]) == 't')

read_args(message, 191)
remove_quotes(message)
parse(message, color, 15)

new found = 0, a = 0
new lang[3], langnum = get_langsnum()

for (new i = 0; i < MAX_CLR; ++i)
{
for (new j = 0; j < langnum; j++)
{
get_lang(j, lang)
format(color2, 15, "%L", lang, g_Colors[i])

if (equali(color, color2))
{
a = i
found = 1
break
}
}
if (found == 1)
break
}

new length = found ? (strlen(color) + 1) : 0

if (++g_msgChannel > 6 || g_msgChannel < 3)
g_msgChannel = 3

new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0

get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message[length])
client_print(pl, print_notify, "%s : %s", name, message[length])
}
else
{
show_hudmessage(pl, "%s", message[length])
client_print(pl, print_notify, "%s", message[length])
}
}
}
console_print(id, "%s : %s", name, message[length])
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message[length])
client_print(0, print_notify, "%s : %s", name, message[length])
console_print(id, "%s : %s", name, message[length])
}
default:
{
show_hudmessage(0, "%s", message[length])
client_print(0, print_notify, "%s", message[length])
console_print(id, "%s", message[length])
}
}

if(a==1) {
client_cmd(0, "spk ^"vox/warning _period message from administration^"")
}

log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)

return PLUGIN_HANDLED
}

ColorChat(id, iSender, fmt[], any:...)
{
new szMsg[192]
szMsg[0] = 0x04
vformat(szMsg[1], charsmax(szMsg)-1, fmt, 4)

if( !iSender )
{
iSender = 1
}

message_begin(id ? MSG_ONE : MSG_ALL, g_msgSayText, _, id)
{
write_byte(iSender)
write_string(szMsg)
}
message_end()
}
ultimu cod , am incercat sa le schimb in toate felurile.


Regulament|My Official Website[V:1.1]|Panel JB[V:1.0]



Last edited by GoreSpintecatoru. on 02-05-2017, 08:18:18; edited 1 time in total
0 0
  
Back to top
View user's profile Send private message
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 01-05-2017, 10:51:02 | Translate post to: ... (Click for more languages)

Nu.. nu merge.. nu sti alt plugin de adminchat? Sau vreo cauza de la ce sa fie? Oare de la ghostchat nu e? Am incercat sa il scot dar tot asa facea.. poate am nevoie de altul.. eu stiu..
0 0
  
Back to top
View user's profile Send private message
GoreSpintecatoru.

[Inactiv o perioada]



Status: Offline
(since 09-11-2017 19:29)
Joined: 18 Feb 2017
Posts: 638, Topics: 28
Location: Romania

Reputation: 762.7
Votes: 40

       
Post Posted: 01-05-2017, 11:10:27 | Translate post to: ... (Click for more languages)

Pai vezi sa nu se suprapuna cu alte plugin-uri de chat sau ceva.

Regulament|My Official Website[V:1.1]|Panel JB[V:1.0]

0 0
  
Back to top
View user's profile Send private message
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 01-05-2017, 14:34:49 | Translate post to: ... (Click for more languages)

Nu se suprapune cu absolut niciun plugin..
0 0
  
Back to top
View user's profile Send private message
destroi112

[DEV]



Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042, Topics: 119
Location: ---------

Reputation: 515.9
Votes: 118

   
Post Posted: 01-05-2017, 23:29:49 | Translate post to: ... (Click for more languages)

Spoiler:



Retired from Amxmodx

0 0
  
Back to top
View user's profile Send private message
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 02-05-2017, 15:15:02 | Translate post to: ... (Click for more languages)

Tot asa e, acuma la u@ e ceva de genul (Echipa) nume: text in loc de ... nume : text, iar la y / u e la fel..
0 0
  
Back to top
View user's profile Send private message
-P!C@-

[Simply Normal]



Status: Offline
(since 21-04-2022 19:07)
Joined: 28 May 2012
Posts: 21086, Topics: 1601
Location: Constanta

Reputation: 1870.3
Votes: 781

Post Posted: 02-05-2017, 19:32:23 | Translate post to: ... (Click for more languages)

Ia baga in server.cfg
ac_msgcolor "2"
Daca nu merge opreste pluginul de chat pe care-l ai, baga-l iar pe cel de la mine si ar trebui sa mearga.




0 0
  
Back to top
View user's profile Send private message
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 03-05-2017, 18:29:55 | Translate post to: ... (Click for more languages)

-P!C@- wrote:
Ia baga in server.cfg
ac_msgcolor "2"
Daca nu merge opreste pluginul de chat pe care-l ai, baga-l iar pe cel de la mine si ar trebui sa mearga.


Degeaba, spatiul e acelasi.. Ce mi-ai dat tu difera de ce am cerut eu, e (ADMIN/PLAYER) culoare team, nume verde si text culoare team, eu am plugin-ul pe care il vreau, e exact asa cum trebuie, mai am nevoie doar sa fie micsorata distanta dintre : si text, atata tot

0 0
  
Back to top
View user's profile Send private message
TwisTer

[GOOGLE SEARCHER]



Status: Offline
(since 12-11-2024 09:55)
Joined: 04 May 2007
Posts: 6962, Topics: 147
Location: Romania

Reputation: 2724.4
Votes: 231

 
Post Posted: 04-05-2017, 10:37:28 | Translate post to: ... (Click for more languages)

E absolut normal sa existe spatiul respectiv atata timp cat este un caracter colorat ascii la inceput care defineste exact aparitia unui bloc de date (caractere colorate).
Mai exact este vorba de codurile ASCII : SOH, STX si ETX.
In cazul asta inclusiv spatiul devine caracter, deci elimina spatiul din format si ar trebui sa mearga.
Incearca varianta lui destroi, el exact asta a facut.

Modifica asa fara spatii :

Code:
case 2:formatex(colored,191,"^1(%L)^4ADMIN^3%s^1:%s", player, "ALL", name, message)
default :formatex(colored,191,"^1(%L)^4ADMIN^1:%s", player, "ALL", message)



0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 04-05-2017, 17:42:47 | Translate post to: ... (Click for more languages)

Daca pun asa, la amx_say u@, etc merge, dar la y si la u, nu merge, asta e problema. Pe mine acolo ma intereseaza, nu la amx_say, u@ , etc. Doar la y(say) si u(say_team).
0 0
  
Back to top
View user's profile Send private message
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 06-05-2017, 09:24:26 | Translate post to: ... (Click for more languages)

UP! Exista vreo rezolvare?
0 0
  
Back to top
View user's profile Send private message
ZPLegendary

[Mentally Stable]



Status: Offline
(since 03-10-2019 20:59)
Joined: 13 Jan 2017
Posts: 142, Topics: 7
Location: Polovragi, GJ

Reputation: 15.4
Votes: 17

     
Post Posted: 17-05-2017, 21:11:43 | Translate post to: ... (Click for more languages)

E ceea ce doresti tu?
Il pui primul in lista.

Spoiler:


Be the one, not anyone.
Currently working on Zombie Legendary 8.1


0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by GoreSpintecatoru., 18 May 2017 06:01



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  
Go to page Previous  1, 2, 3  Next    


The time now is 04-03-2025, 01:48:33
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password