[Rezolvat] Cerere rank in chat

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 .
Post Reply
User avatar
EpsiloN
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 16 Sep 2013, 18:42
Detinator Steam: Da
CS Status: OnLine
Detinator server CS: EpsiloN's Server
SteamID: godskilled
Location: Brăila
Has thanked: 72 times
Been thanked: 5 times
Contact:

19 Jan 2014, 18:06

Salut extreamcs
Ar putea sa ma ajute si pe mine cineva cu un plugin asemanator cu rang admin chat, numai ca eu vreau sa arate rank-ul unui jucator care este inclus in Top 15 si cand scrie pe chat sa arate asa:
[Rank 8] Player: salut

EDIT: Daca nu se poate sa arate doar pana la rank 15 ati putea sa il faceti cu nr total de rank-uri

Va multumesc!
Zonek
User avatar
EpsiloN
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 16 Sep 2013, 18:42
Detinator Steam: Da
CS Status: OnLine
Detinator server CS: EpsiloN's Server
SteamID: godskilled
Location: Brăila
Has thanked: 72 times
Been thanked: 5 times
Contact:

20 Jan 2014, 23:52

UP! Se mai uita cineva?
Acest plugin mi se pare ca il are si llg-ul (imi cer scuze de reclama)
mr.f3lyx
Membru, skill +2
Membru, skill +2
Posts: 610
Joined: 10 Nov 2013, 20:24
Detinator Steam: Da
Location: Palermo, Italy
Has thanked: 69 times
Been thanked: 17 times
Contact:

21 Jan 2014, 16:50

Last edited by NuRoFeN [;x] on 21 Jan 2014, 17:16, edited 1 time in total.
Reason: Bro el nu vrea rank stats , el vrea rang_chat_admin numai ca in loc de grade sa fie ranku !
User avatar
EpsiloN
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 16 Sep 2013, 18:42
Detinator Steam: Da
CS Status: OnLine
Detinator server CS: EpsiloN's Server
SteamID: godskilled
Location: Brăila
Has thanked: 72 times
Been thanked: 5 times
Contact:

22 Jan 2014, 21:52

multumesc pentru efort felix dar dupa cum spune nurofen si are dreptate, eu vreau un rang_admin_chat dar sa fie pe rank
User avatar
NuRoFeN [;x]
Membru, skill +2
Membru, skill +2
Posts: 828
Joined: 21 Aug 2012, 14:47
Detinator Steam: Da
CS Status: Inactiv !
Detinator server CS: DR.CS1.RO
SteamID: eualexandru
Reputatie: Fost moderator
Location: Rm.Valcea
Has thanked: 66 times
Been thanked: 61 times
Contact:

22 Jan 2014, 22:25

EpsiloN wrote:multumesc pentru efort felix dar dupa cum spune nurofen si are dreptate, eu vreau un rang_admin_chat dar sa fie pe rank
Eventual ia legatura cu Askhanar..
mr.f3lyx
Membru, skill +2
Membru, skill +2
Posts: 610
Joined: 10 Nov 2013, 20:24
Detinator Steam: Da
Location: Palermo, Italy
Has thanked: 69 times
Been thanked: 17 times
Contact:

22 Jan 2014, 22:48

Am inteles trebuie facut ca am cautat si n-am gasit :|
User avatar
EpsiloN
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 16 Sep 2013, 18:42
Detinator Steam: Da
CS Status: OnLine
Detinator server CS: EpsiloN's Server
SteamID: godskilled
Location: Brăila
Has thanked: 72 times
Been thanked: 5 times
Contact:

24 Jan 2014, 00:20

NuRoFeN [;x] wrote:
EpsiloN wrote:multumesc pentru efort felix dar dupa cum spune nurofen si are dreptate, eu vreau un rang_admin_chat dar sa fie pe rank
Eventual ia legatura cu Askhanar..
Mda... cam asta e problema, Askhanar s-a retras si nu stiu daca mai lucreaza (nici macar in timpul liber)
Daca l-as gasi pe undeva prin Braila, i-as spune
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

24 Jan 2014, 00:51

| Afiseaza codul
#include <amxmodx>
#include <csx>
#include <fakemeta>

#define PDATA_SAFE 2
#define OFFSET_LINUX 5
#define OFFSET_CSTEAMS 114

enum
{
	FM_CS_TEAM_UNASSIGNED = 0,
	FM_CS_TEAM_T,
	FM_CS_TEAM_CT,
	FM_CS_TEAM_SPECTATOR
}

new const team_names[][] =
{
	"UNASSIGNED",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

enum
{
	RED = 1,
	BLUE,
	GREY
}

new g_msg_saytext, g_msg_teaminfo;

new bool:g_valid_player[33];

public plugin_init()
{
	register_plugin("Chat Rank", "1.0", "cyby")
	
	register_clcmd("say", "hook_say")
	
	g_msg_saytext = get_user_msgid("SayText")
	g_msg_teaminfo = get_user_msgid("TeamInfo")
}

public client_putinserver(id)
	g_valid_player[id] = true
	
public client_disconnect(id)
	g_valid_player[id] = false
	
public hook_say(id)
{
	if(!g_valid_player[id])
		return PLUGIN_HANDLED;

	static chat[192], users_team, name[32]
	read_argv(1, chat, charsmax(chat))
	get_user_name(id, name, charsmax(name) - 1)
	users_team = fm_cs_get_user_team(id)

	static stats[8], crap[8], rank;
	rank = get_user_stats(id, stats, crap)
	if(is_user_alive(id))
	{
		if(users_team == FM_CS_TEAM_T)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 %s:^1 %s", rank, name, chat)	
		}
		else if(users_team == FM_CS_TEAM_CT)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 %s:^1 %s", rank, name, chat)	
		}
	}
	else
	{
		if(users_team == FM_CS_TEAM_SPECTATOR)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, GREY, "^4[Rank: %d]^3 *SPEC* %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, GREY, "^4[Rank: %d]^3 *SPEC* %s:^1 %s", rank, name, chat)	
		}
		else if(users_team == FM_CS_TEAM_T)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 *DEAD* %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 *DEAD* %s:^1 %s", rank, name, chat)	
		}
		else if(users_team == FM_CS_TEAM_CT)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 *DEAD* %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 *DEAD* %s:^1 %s", rank, name, chat)	
		}		
	}
	return PLUGIN_HANDLED
}

chat_color(team_format, player, player_team, color, const chat_msg[], ...)
{
	static msg[192]
	vformat(msg, charsmax(msg) - 1, chat_msg, 6)
	
	if (team_format)
	{
		static id, i, players[32], count
		get_players(players, count, "e", team_names[player_team])
		
		for(i = 0; i < count; i++)
		{
			id = players
			
			if(!id) continue;
			
			message_begin(MSG_ONE_UNRELIABLE, g_msg_saytext, _, id)
			write_byte(player)
			write_string(msg)
			message_end()
			
		}
	}
	else
	{
		if (player_team == color)
		{
			message_begin(MSG_BROADCAST, g_msg_saytext)
			write_byte(player)
			write_string(msg)
			message_end()
		}
		else
		{
			message_begin(MSG_BROADCAST, g_msg_teaminfo)
			write_byte(player)
			write_string(team_names[color])
			message_end()
			
			message_begin(MSG_BROADCAST, g_msg_saytext)
			write_byte(player)
			write_string(msg)
			message_end()
			
			message_begin(MSG_BROADCAST, g_msg_teaminfo)
			write_byte(player)
			write_string(team_names[player_team])
			message_end()
		}
	}
}

stock fm_cs_get_user_team(id)
{
	if(pev_valid(id) != PDATA_SAFE)
		return FM_CS_TEAM_UNASSIGNED;
	
	return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}


Poza:
Image
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
User avatar
EpsiloN
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 16 Sep 2013, 18:42
Detinator Steam: Da
CS Status: OnLine
Detinator server CS: EpsiloN's Server
SteamID: godskilled
Location: Brăila
Has thanked: 72 times
Been thanked: 5 times
Contact:

24 Jan 2014, 17:39

Multumesc mult cyby! :);)
Esti salvatorul meu >:D< ^:)^

EDIT: S-a rezolvat.
Se poate da TC.
User avatar
roberteeel
Membru eXtream
Membru eXtream
Posts: 4440
Joined: 05 Sep 2012, 10:39
Detinator Steam: Nu
Reputatie: Nick anterior: QAZW, Robert.ultrasFarul, CT 18 ROS
Restrictie schimbare nume
Fost moderator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 312 times
Been thanked: 357 times

24 Jan 2014, 19:28

cyby wrote:
| Afiseaza codul
#include <amxmodx>
#include <csx>
#include <fakemeta>

#define PDATA_SAFE 2
#define OFFSET_LINUX 5
#define OFFSET_CSTEAMS 114

enum
{
	FM_CS_TEAM_UNASSIGNED = 0,
	FM_CS_TEAM_T,
	FM_CS_TEAM_CT,
	FM_CS_TEAM_SPECTATOR
}

new const team_names[][] =
{
	"UNASSIGNED",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

enum
{
	RED = 1,
	BLUE,
	GREY
}

new g_msg_saytext, g_msg_teaminfo;

new bool:g_valid_player[33];

public plugin_init()
{
	register_plugin("Chat Rank", "1.0", "cyby")
	
	register_clcmd("say", "hook_say")
	
	g_msg_saytext = get_user_msgid("SayText")
	g_msg_teaminfo = get_user_msgid("TeamInfo")
}

public client_putinserver(id)
	g_valid_player[id] = true
	
public client_disconnect(id)
	g_valid_player[id] = false
	
public hook_say(id)
{
	if(!g_valid_player[id])
		return PLUGIN_HANDLED;

	static chat[192], users_team, name[32]
	read_argv(1, chat, charsmax(chat))
	get_user_name(id, name, charsmax(name) - 1)
	users_team = fm_cs_get_user_team(id)

	static stats[8], crap[8], rank;
	rank = get_user_stats(id, stats, crap)
	if(is_user_alive(id))
	{
		if(users_team == FM_CS_TEAM_T)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 %s:^1 %s", rank, name, chat)	
		}
		else if(users_team == FM_CS_TEAM_CT)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 %s:^1 %s", rank, name, chat)	
		}
	}
	else
	{
		if(users_team == FM_CS_TEAM_SPECTATOR)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, GREY, "^4[Rank: %d]^3 *SPEC* %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, GREY, "^4[Rank: %d]^3 *SPEC* %s:^1 %s", rank, name, chat)	
		}
		else if(users_team == FM_CS_TEAM_T)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 *DEAD* %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, RED, "^4[Rank: %d]^3 *DEAD* %s:^1 %s", rank, name, chat)	
		}
		else if(users_team == FM_CS_TEAM_CT)
		{
			if(get_user_flags(id) & ADMIN_SLAY)
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 *DEAD* %s:^4 %s", rank, name, chat)
			else
				chat_color(0, id, users_team, BLUE, "^4[Rank: %d]^3 *DEAD* %s:^1 %s", rank, name, chat)	
		}		
	}
	return PLUGIN_HANDLED
}

chat_color(team_format, player, player_team, color, const chat_msg[], ...)
{
	static msg[192]
	vformat(msg, charsmax(msg) - 1, chat_msg, 6)
	
	if (team_format)
	{
		static id, i, players[32], count
		get_players(players, count, "e", team_names[player_team])
		
		for(i = 0; i < count; i++)
		{
			id = players
			
			if(!id) continue;
			
			message_begin(MSG_ONE_UNRELIABLE, g_msg_saytext, _, id)
			write_byte(player)
			write_string(msg)
			message_end()
			
		}
	}
	else
	{
		if (player_team == color)
		{
			message_begin(MSG_BROADCAST, g_msg_saytext)
			write_byte(player)
			write_string(msg)
			message_end()
		}
		else
		{
			message_begin(MSG_BROADCAST, g_msg_teaminfo)
			write_byte(player)
			write_string(team_names[color])
			message_end()
			
			message_begin(MSG_BROADCAST, g_msg_saytext)
			write_byte(player)
			write_string(msg)
			message_end()
			
			message_begin(MSG_BROADCAST, g_msg_teaminfo)
			write_byte(player)
			write_string(team_names[player_team])
			message_end()
		}
	}
}

stock fm_cs_get_user_team(id)
{
	if(pev_valid(id) != PDATA_SAFE)
		return FM_CS_TEAM_UNASSIGNED;
	
	return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}


Poza:
Image

Il poti face doar pentru cei din /top15 si sa nu se incurce cu plugin-ul lui Ex3cution?
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

24 Jan 2014, 22:20

Link la pluginul lui.
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
Post Reply

Return to “Cereri”

  • Information