Cerere admin rang in u@

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

17 Jan 2019, 01:10

Plugin Cerut: rang admin in u@ adica in chat-ul adminilor
Descriere (adica ce face el mai exact): in chat la admini cand scrii u@ sa iti apara In loc de [ADMIN]Nikod salut sa iti apara gradul tau [Detinator]Salut dar pe chatul adminilor atat. pe chatul normal am rang_admin_chat pluginul
Serverul ruleaza (HLDS/ReHLDS): hlds
Versiune AMX Mod X: nu stiu
Modul Serverului: classic

stima si respect
Last edited by Rainq on 21 Jan 2019, 01:07, edited 1 time in total.
Reason: Editat dupa model
RoyalServer 2
User avatar
WHOAMI?
eXtream Mod
eXtream Mod
Posts: 999
Joined: 17 Dec 2013, 19:51
Detinator Steam: Da
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (o luna)
Location: US
Has thanked: 30 times
Been thanked: 20 times

17 Jan 2019, 01:36

Vezi asa :
| Afiseaza codul
#include <amxmodx>

#pragma semicolon 1

enum Color {
    NORMAL = 1, GREEN, TEAM_COLOR,  GREY, RED, BLUE,
};

new TeamName[][] =  {
    "", "TERRORIST", "CT", "SPECTATOR"
};

// start cstrike.inc
enum CsTeams {
    CS_TEAM_UNASSIGNED = 0,
    CS_TEAM_T = 1,
    CS_TEAM_CT = 2,
    CS_TEAM_SPECTATOR = 3
};

native CsTeams:cs_get_user_team(index);
// end cstrike.inc

// edit here

#define MAX_GROUPS 2

new g_Rang[MAX_GROUPS][] = {
    "Detinator",
    "Admin"
};

new g_RangFlag[MAX_GROUPS][] = {
    "abcdefghijklmnopqrstu",
    "bcdefijkmno"
};

// end edit here

new g_RangFlag_Value[MAX_GROUPS];
new cvar_type, gType[2][50];

public plugin_init() {
    register_plugin("RangAdminChat", "0.7", "Ex3cuTioN aka Arion HD.");
    
// register_clcmd("say","hook_say");
    register_clcmd("say_team","hook_say2");
    
    for(new i = 0; i < MAX_GROUPS; i++)
        g_RangFlag_Value = read_flags(g_Rang);
    
    cvar_type = register_cvar("amx_rang_chat","3");
    
    switch(get_pcvar_num(cvar_type)) {
        case 1 : {
            gType[0] = "^x04*%s*^x03%s^x01 : %s";
            gType[1] = "^x04*%s*^x01(%s)^x03 %s^x01 : %s";
        }
        case 2 : {
            gType[0] = "^x04(%s)^x03%s^x01 : %s";
            gType[1] = "^x04(%s)^x01(%s)^x03 %s^x01 : %s";
        }
        case 3 : {
            gType[0] = "^x04[%s]^x03 %s^x01 : %s";
            gType[1] = "^x04[%s]^x01(%s)^x03 %s^x01 : %s";
        }
    }
}

public hook_say(id) {
    if(is_user_bot(id))
        return PLUGIN_CONTINUE;
    
    static chat[192];
    read_args(chat, sizeof(chat) - 1);
    remove_quotes(chat);
    
    if(equali(chat,""))
        return PLUGIN_CONTINUE;
    
    if(is_user_admin(id)) {
        new bool:hasRang = false;
        for(new i = 0; i < MAX_GROUPS; i++) {
            if(get_user_flags(id) == read_flags(g_RangFlag))  {
                switch(cs_get_user_team(id)) {
                    case CS_TEAM_T : ColorChat(0, RED, gType[0],  g_Rang, get_name(id), chat);
                    case CS_TEAM_CT : ColorChat(0, BLUE, gType[0], g_Rang, get_name(id), chat);
                    case CS_TEAM_SPECTATOR : ColorChat(0, GREY, gType[0], g_Rang, get_name(id), chat);
                }
                hasRang = true;
            }
        }
        if(!hasRang)
            get_team(id, chat);
    }
    else 
        get_team(id, chat);
    
    return PLUGIN_HANDLED;
}

stock get_team(id, chat[]) {
    switch(cs_get_user_team(id)) {
        case CS_TEAM_T : ColorChat(0, RED, "%s%s^x01 : %s", is_user_alive(id) ? "" : "*DEAD*",  get_name(id), chat);
        case CS_TEAM_CT : ColorChat(0, BLUE, "%s%s^x01 : %s", is_user_alive(id) ? "" : "*DEAD*",  get_name(id), chat);
        case CS_TEAM_SPECTATOR : ColorChat(0, GREY, "*SPEC*%s^x01 : %s",  get_name(id), chat);
    }
}

public hook_say2(id) {
    if(is_user_bot(id))
        return PLUGIN_CONTINUE;
    
    static chat[192];
    read_args(chat, sizeof(chat) - 1);
    remove_quotes(chat);
    
    if(equali(chat,""))
        return PLUGIN_CONTINUE;
    
    new players[32], num;
    get_players(players, num, "c");
                
    if(is_user_admin(id)) {
        new bool:hasRang = false;
        for(new i = 0; i < MAX_GROUPS; i++) {
            if(get_user_flags(id) == read_flags(g_RangFlag)) {
                for(new x = 0; x < num; x++) {
                    if(get_user_team(players[x]) == get_user_team(id)) {
                        switch(cs_get_user_team(id)) {
                            case CS_TEAM_T : ColorChat(players[x], RED, gType[1], g_Rang, "Terrorist", get_name(id), chat);
                            case CS_TEAM_CT : ColorChat(players[x], BLUE, gType[1], g_Rang, "Counter-Terrorist",  get_name(id), chat);
                            case CS_TEAM_SPECTATOR : ColorChat(players[x], GREY, gType[1], g_Rang, "Spectator", get_name(id), chat);
                        }
                    }
                }
                hasRang = true;
            }
        }
        if(!hasRang)
            get_team2(id, num, players, chat);
    }
    else
        get_team2(id, num, players,  chat);
        
    return PLUGIN_HANDLED;
}

stock get_team2(id, num, players[],  chat[]) {
    for(new x = 0; x < num; x++) {
        if(get_user_team(players[x]) == get_user_team(id)) {
            switch(cs_get_user_team(id)) {
                case CS_TEAM_T : ColorChat(players[x], RED, "^x01(Terrorist)^x03 %s^x01 : %s", get_name(id), chat);
                case CS_TEAM_CT : ColorChat(players[x], BLUE, "^x01(Counter-Terrorist)^x03 %s^x01 : %s", get_name(id), chat);
                case CS_TEAM_SPECTATOR : ColorChat(players[x], GREY, "^x01(Spectator)^x03 %s^x01 : %s", get_name(id), chat);
            }
        }
    }
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) {
    new message[256];

    switch(type) {
        case NORMAL: // clients scr_concolor cvar color
        {
            message[0] = 0x01;
        }
        case GREEN: // Green
        {
            message[0] = 0x04;
        }
        default: // White, Red, Blue
        {
            message[0] = 0x03;
        }
    }

    vformat(message[1], 251, msg, 4);

    // Make sure message is not longer than 192 character. Will crash the server.
    message[192] = '^0';

    new team, ColorChange, index, MSG_Type;
    
    if(id) {
        MSG_Type = MSG_ONE;
        index = id;
    } else {
        index = FindPlayer();
        MSG_Type = MSG_ALL;
    }
    
    team = get_user_team(index);
    ColorChange = ColorSelection(index, MSG_Type, type);

    ShowColorMessage(index, MSG_Type, message);
        
    if(ColorChange) {
        Team_Info(index, MSG_Type, TeamName[team]);
    }
}

ShowColorMessage(id, type, message[]) {
    static bool:saytext_used;
    static get_user_msgid_saytext;
    if(!saytext_used)
    {
        get_user_msgid_saytext = get_user_msgid("SayText");
        saytext_used = true;
    }
    message_begin(type, get_user_msgid_saytext, _, id);
    write_byte(id);
    write_string(message);
    message_end();    
}

Team_Info(id, type, team[]) {
    static bool:teaminfo_used;
    static get_user_msgid_teaminfo;
    
    if(!teaminfo_used) {
        get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
        teaminfo_used = true;
    }
    message_begin(type, get_user_msgid_teaminfo, _, id);
    write_byte(id);
    write_string(team);
    message_end();

    return 1;
}

ColorSelection(index, type, Color:Type) {
    switch(Type) {
        case RED:
        {
            return Team_Info(index, type, TeamName[1]);
        }
        case BLUE:
        {
            return Team_Info(index, type, TeamName[2]);
        }
        case GREY:
        {
            return Team_Info(index, type, TeamName[0]);
        }
    }

    return 0;
}

FindPlayer() {
    new i = -1;

    while(i <= get_maxplayers()) {
        if(is_user_connected(++i))
            return i;
    }

    return -1;
}

stock get_name (id) {
    new name[32];
    get_user_name(id, name, 31);
    return name;
}

// start amxmisc.inc
stock is_user_admin(id) {
    new __flags=get_user_flags(id);
    return (__flags>0 && !(__flags&ADMIN_USER));
}
// end amxmisc.inc
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

17 Jan 2019, 02:34

Salut , nu ai inteles nu pe chat-ul normal imi trebuie mie , mie imi trebuie pe chatul adminilor sa apara rang-ul tau in loc de standard adica de [ADMIN]
User avatar
DevilBoy.eXe
Super moderator
Super moderator
Posts: 1678
Joined: 05 Jun 2016, 23:04
Detinator Steam: Da
Detinator server CS: GO.WARED.RO
SteamID: DevilBoy_eXe
Reputatie: Super Moderator
Fond eXtream: 0
Location: beyond the time
Discord: zeux.
Has thanked: 15 times
Been thanked: 71 times
Contact:

17 Jan 2019, 02:38

Foloseste astea
https://forums.alliedmods.net/showthread.php?t=297952
https://forums.alliedmods.net/showthread.php?t=272418
Sunt foarte flexibile si optimizate spre deosebire de alte plugine hardcoded
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

17 Jan 2019, 03:00

Nu e ceea ce vreau eu devil dar apreciez ca ai incercat
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

17 Jan 2019, 20:04

el vrea pe u@ să i se aplice gradele

spune gradele și accesele lor
Last edited by levin on 17 Jan 2019, 21:58, edited 1 time in total.
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
EnTeR_
Membru, skill +2
Membru, skill +2
Posts: 577
Joined: 13 Sep 2014, 16:36
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 29 times

17 Jan 2019, 20:08

cereri-pluginuri/grade-t337368.html
Modifici cu gradele tale, compilezi și înlocuiești cu pluginul adminchat
Discord: eyekon13
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

17 Jan 2019, 21:11

| Afiseaza codul
/* 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>


#pragma tabsize 0;

new g_msgChannel



#define MAX_CLR 10

#define MAX_GROUPS 7


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;

new g_AdminChatFlag = ADMIN_CHAT;

new GroupsNames [MAX_GROUPS] [ ] =
{
	"Detinator",
	"Owner",
	"Co-Owner",
	"Administrator",
	"Moderator",
	"Helper",
	"Slot"	
};

new GroupsFlags [MAX_GROUPS] [ ] =
{
	"abcdefghijklmnopqrstu",
	"abcdefijklmnopqrst",
	"bcdefijkmnopqrst",
	"bcdefijkmno",
	"bcdefijk",
	"bcijef",
	"b"	
};

new GroupsFlagsValues [MAX_GROUPS];

public plugin_init()
	
{

new admin_chat_id



register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")

register_dictionary("adminchat.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")

admin_chat_id = 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");
	
}



new str[1]

get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)

   for ( new i = 0; i < MAX_GROUPS; i++ )
    
     GroupsFlagsValues  = read_flags ( GroupsFlags  );

}



public cmdSayChat(id)

{

if (!access(id, g_AdminChatFlag))
	
{
	
	return PLUGIN_CONTINUE
	
}



new said[6], i = 0

read_argv(1, said, 5)



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



if (!i || i > 3)
	
{
	
	return PLUGIN_CONTINUE
	
}



new message[192], a = 0

read_args(message, 191)

remove_quotes(message)



switch (said)
	
{
	
	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 name[32], authid[32], userid



get_user_authid(id, authid, 31)

get_user_name(id, name, 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[1] + float(g_msgChannel) / 35.0



set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[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])
					
					ColorChat(pl, "!4ADMIN!1 %s!1 :!4 %s", name, message[i + n]) 
					
				}
				
				else
					
				{
					
					show_hudmessage(pl, "%s", message[i + n])
					
					ColorChat(pl, "!4%s", message[i + n])
					
				}
				
			}
			
		}
		
	}
	
	case 2:
		
	{
		
		show_hudmessage(0, "%s :   %s", name, message[i + n])
		
		ColorChat(0, "!4ADMIN!1 %s!1 :!3 %s", name, message[i + n]) 
		
	}
	
	default:
	
{
	
	show_hudmessage(0, "%s", message[i + n])
	
	ColorChat(0, "!4%s", message[i + n]) 
	
}

}



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



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))
	{
		for ( new i = 0; i < MAX_GROUPS; i ++ )
     		{
			if ( get_user_flags( id ) == GroupsFlagsValues  )

				format(message, 191, "[!4%s!1]!3 %s!1:  %s",  GroupsNames , name, message[1])
		}
	}
	else
	{		
		format(message, 191, "[!4%L!1]!3 %s!1:  %s", id, "PLAYER", name, message[1])
	}
	
	
	
	get_players(players, inum)
	
	
	
	for (new i = 0; i < inum; ++i)
		
{
	
	// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
	
	if (players != id && get_user_flags(players) & g_AdminChatFlag)
		
		ColorChat(players[i], "!1%s", message)
		
	}
	
	
	
	ColorChat(id, "!1%s", 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
	
	
	
	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, "!1(!4ADMINS!1)!3 %s!1 :   %s", name, message)
	
	for ( new i = 0; i < MAX_GROUPS; i ++ )
     	{
		if ( get_user_flags( id ) == GroupsFlagsValues [i] )

			format(message, 191, "[!4%s!1]!3 %s!1:  %s",  GroupsNames [i], name, message )
	}
	
	console_print(id, "%s", message)
	
	
	
	for (new i = 0; i < inum; ++i)
		
{
	
	if (access(players[i], g_AdminChatFlag))
		
		ColorChat(players[i], "%s", 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)
	
	ColorChat(0, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	
	console_print(id, "%L", LANG_PLAYER, "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)
	
	
	
	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)



if (id && id != priv)
	
	ColorChat(id, "!1(!3%s!1)!3 %s!1 :!4   %s", name, name2, message[length])
	
	
	
	ColorChat(priv, "!1(!3%s!1)!3 %s!1 :!4   %s", name, name2, message[length])
	
	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])
					
					ColorChat(pl, "!4ADMIN!1 %s!1 :!4 %s", name, message[length]) 
					
				}
				
				else
					
				{
					
					show_hudmessage(pl, "%s", message[length])
					
					ColorChat(pl, "!4%s", message[length])
					
				}
				
			}
			
		}
		
		console_print(id, "%s :  %s", name, message[length])
		
	}
	
	case 2:
		
	{
		
		show_hudmessage(0, "%s :   %s", name, message[length])
		
		ColorChat(0, "!4ADMIN!1 %s!1 :!3 %s", name, message[length]) 
		
		console_print(id, "%s :  %s", name, message[length])
		
	}
	
	default:
	
{
	
	show_hudmessage(0, "%s", message[length])
	
	ColorChat(0, "!4%s", message[length])
	
	console_print(id, "%s", message[length])
	
}

}



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

}

stock ColorChat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!4", "^4")
	replace_all(msg, 190, "!1", "^1")
	replace_all(msg, 190, "!3", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
	}
} 


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE

*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }

*/


asta e suras
deci merge e ok doar ca scrisul e la fel ca pe chat si nu stiu daca o sa se destinga se poate modifica cumva?
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

18 Jan 2019, 13:29

upp
User avatar
EnTeR_
Membru, skill +2
Membru, skill +2
Posts: 577
Joined: 13 Sep 2014, 16:36
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 29 times

18 Jan 2019, 14:02

Modifici în publicul "cmdChat" după bunul plac, ai acolo la linia aia "format(message, 191, "[!4%s!1]!3 %s!1: %s", GroupsNames , name, message )"
Discord: eyekon13
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

18 Jan 2019, 18:50

enter e simplu pentru tine dar eu nu o stiu o boaba.. de scripting
nikod1606
Membru, skill +1
Membru, skill +1
Posts: 158
Joined: 04 Jan 2019, 23:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

22 Jan 2019, 00:08

upppp
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests