Jump to content

TAG CHAT


LuK.ZEW #

Recommended Posts

Descriere: Cu ajutorul acestui plugin va puneti la alegere un tag care va aparea in fata fiecarui pleyer ce va scrie pe chat . Un exemplu:

[Pleyer] LucHyaNN. : Salut

# Download: Aici
# Nume:tag_chat
# Instalare:

=> Fisierul tag_chat.sma il puneti in addons/amxmodx/scripting
=> Fisierul tag_chat.amxx il puneti in addons/amxmodx/plugins
=> Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

tag_chat.amxx

#include <amxmodx>
#include <amxmisc>
#include <fun>
 
new const
PLUGIN[] = "",
VERSION[] = "1.0",
AUTHOR[] = "cras";
 
#define TAG "[Pleyer]"
 
public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR)
 
register_clcmd("say","cmdSay")
register_clcmd("say_team","cmdSayTeam")
}
public cmdSay(id) {
new szArgs[192],szName[32]
read_args(szArgs,charsmax(szArgs))
get_user_name(id,szName,charsmax(szName))
remove_quotes(szArgs)
 
if(!szArgs[0])
return 1
 
 
color(0,"!g%s !team%s : !y%s",TAG,szName,szArgs)
return 1
}
public cmdSayTeam(id) {
new szArgs[192],szName[32]
read_args(szArgs,charsmax(szArgs))
get_user_name(id,szName,charsmax(szName))
remove_quotes(szArgs)
 
if(!szArgs[0])
return 1
 
if(szArgs[0] == '@')
{
new iPlayers[32],iNum,player
get_players(iPlayers,iNum) //ch
if(is_user_admin(id))
{
for(new i = 0;i < iNum;i++)
{
player = iPlayers
if(is_user_admin(player))
{
replace_all(szArgs,charsmax(szArgs),"@","")
color(player,"!y(ADMIN) !g%s !y%s : %s",TAG,szName,szArgs)
}
}
}
else
{
for(new i = 0;i < iNum;i++)
{
player = iPlayers
if(is_user_admin(player))
{
replace_all(szArgs,charsmax(szArgs),"@","")
color(player,"!y(PLAYER) !g%s !y%s : %s",TAG,szName,szArgs)
}
}
replace_all(szArgs,charsmax(szArgs),"@","")
color(id,"!y(PLAYER) !g%s !y %s: %s",TAG,szName,szArgs)
}
}
else
{
new iPlayers[32],iNum,player
switch(get_user_team(id))
{
case 1:
{
get_players(iPlayers,iNum,"e","TERRORIST")
for(new i = 0;i < iNum;i++)
{
player = iPlayers
color(player,"!team(Terrorist) !g%s !team%s !y: %s",TAG,szName,szArgs)
}
}
case 2:
{
get_players(iPlayers,iNum,"e","CT")
for(new i = 0;i < iNum;i++)
{
player = iPlayers
color(player,"!team(Counter-Terrorist) !g%s !team%s !y: %s",TAG,szName,szArgs)
}
}
case 3:
{
get_players(iPlayers,iNum,"e","SPECTATOR")
for(new i = 0;i < iNum;i++)
{
player = iPlayers
color(player,"!team(Spectator) !g%s !team%s !y: %s",TAG,szName,szArgs)
}
}
}
}
return 1
}
stock color(const id,const input[ ],any:...) {
new count = 1,players[32]
 
static msg[191]
vformat(msg,190,input,3)
 
replace_all(msg,190,"!g","^4") //verde
replace_all(msg,190,"!y","^1") //- galben
replace_all(msg,190,"!team","^3") //- echipa
replace_all(msg,190,"!n","^0") //- normal
 
if(id) players[0] = id; else get_players(players,count,"ch")
{
for(new i = 0; i < count; i++)
{
if(is_user_connected(players))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players)
write_byte(players)
write_string(msg)
message_end()
}
}
}
}

  • Like 2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...