Add Steam Prefix in Chat Menager

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
mi0
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 534
Регистриран на: 09 Дек 2016, 22:02
Се отблагодари: 97 пъти
Получена благодарност: 120 пъти
Обратна връзка:

Add Steam Prefix in Chat Menager

Мнение от mi0 » 21 Дек 2019, 22:26

None of the ones above will work.

That one is using ReUnion detection trough ReAPI perhaps, it would work.

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <chatmanager>
#include <reapi>

#define STEAM_PREFIX "&x04[Steam]"

public plugin_init()
{
	register_plugin("CM: Steam Prefix", "1.0", "OciXCrom")
}

public client_authorized(id)
{
	if(is_user_steam(id))
	{
		set_task(3.0, "set_steam_prefix", id)
	}
}

public set_steam_prefix(id)
{
	if(is_user_connected(id))
	{
		cm_set_user_prefix(id, STEAM_PREFIX)
	}
}
aka kurdokoleno
Catch Mod - 87.121.112.232:27021

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 22 Дек 2019, 13:33

Dont working :
L 12/22/2019 - 12:24:19: [AMXX] Displaying debug trace (plugin "ls-chat-steam.amxx", version "1.0")
L 12/22/2019 - 12:24:19: [AMXX] Run time error 10: native error (native "REU_GetAuthtype")
L 12/22/2019 - 12:24:19: [AMXX] [0] ls-chat-steam.sma::client_authorized (line 28)
L 12/22/2019 - 12:24:20: [ReAPI] Reunion: isn't available
L 12/22/2019 - 12:24:20: [AMXX] Displaying debug trace (plugin "ls-chat-steam.amxx", version "1.0")
L 12/22/2019 - 12:24:20: [AMXX] Run time error 10: native error (native "REU_GetAuthtype")
L 12/22/2019 - 12:24:20: [AMXX] [0] ls-chat-steam.sma::client_authorized (line 28)
L 12/22/2019 - 12:24:24: [ReAPI] Reunion: isn't available
L 12/22/2019 - 12:24:24: [AMXX] Displaying debug trace (plugin "ls-chat-steam.amxx", version "1.0")
L 12/22/2019 - 12:24:24: [AMXX] Run time error 10: native error (native "REU_GetAuthtype")
L 12/22/2019 - 12:24:24: [AMXX] [0] ls-chat-steam.sma::client_authorized (line 28)

Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

Add Steam Prefix in Chat Menager

Мнение от atmax » 22 Дек 2019, 14:56

Is-chat-steam.amxx. Is that the same plugin for steam prefix? Otherways you need natives for steam-prefix plugin.
Rest in peace my friend I always will remember you! 🖤👊

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 22 Дек 2019, 15:32

Its same just i set name ls-chat i set code from mi0 with reapi

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Add Steam Prefix in Chat Menager

Мнение от OciXCrom » 22 Дек 2019, 16:05

Looks like this won't work without a forward. Here's what you should do:

1. Update the plugin to the latest version - viewtopic.php?f=21&t=1843 (I just posted an update).
* There's no need to replace the .ini file.

2. Use this sub-plugin:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <chatmanager>

#if !defined MAX_PLAYERS
	const MAX_PLAYERS = 32
#endif

#define STEAM_PREFIX "&x04[Steam]"

new bool:g_bIsSteam[MAX_PLAYERS + 1]

public plugin_init()
{
	register_plugin("CM: Steam Prefix", "1.0", "OciXCrom")
}

public client_authorized(id)
{
	g_bIsSteam[id] = is_user_steam(id)

	if(g_bIsSteam[id])
	{
		cm_on_player_data_updated(id)
	}
}

public cm_on_player_data_updated(id)
{
	if(g_bIsSteam[id])
	{
		cm_set_user_prefix(id, STEAM_PREFIX)
	}
}

bool:is_user_steam(id)
{
	static iPointer

	if(iPointer || (iPointer = get_cvar_pointer("dp_r_id_provider")))
	{
		server_cmd("dp_clientinfo %d", id)
		server_exec()

		return get_pcvar_num(iPointer) == 2
	}

	return false
}
Tested and works.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 22 Дек 2019, 16:50

Thanks OciXCrom now working good show prefix, but when somebody is ADMIN or Owner can tell two prefix [STEAM][Powered][rank]:

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Add Steam Prefix in Chat Menager

Мнение от OciXCrom » 22 Дек 2019, 17:07

Post the [Format Definitions] from your ChatManager.ini file.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 22 Дек 2019, 17:09

Код за потвърждение: Избери целия код

[Format Definitions]
# In this section you can define chat formats that you can assign to different users in the [User Formats] section.
# You should create a different format for the say and say_team chat, if you don't wan't them to look the same.
# You can use the following placeholders: $admin_prefix$, $dead_prefix$, $team$, $name$, $custom_name$, $ip$, $steam$, $userid$, $chat_color$, $message$, $time$
# You can also use these, but they need to be enabled in the .sma file first: $health$, $armor$, $frags$, $deaths$, $city$, $country$, $country_code$, $continent$, $continent_code$
# Using OciXCrom's Rank System gives you access to even more placeholders: $rank$, $current_xp$, $next_xp$, $level$, $next_level$, $next_rank$. Only the first one is enabled by default.
# To enable an additional placeholder, simply locate the #define ARG_ line in the beginning of the .sma file and uncomment it (remove //), then recompile the plugin.
# Syntax: format name = format style

format_admin = $dead_prefix$ &x04$admin_prefix$ &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
format_admin_team = $dead_prefix$ ($team$) &x04$admin_prefix$ &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
format_player = $dead_prefix$ &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
format_player_team = $dead_prefix$ ($team$) &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$

log_say = [ $ip$ | $steam$ ] $dead_prefix$ $name$: $message$
log_team = [ $ip$ | $steam$ ] ($team$) $dead_prefix$ $name$: $message

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Add Steam Prefix in Chat Menager

Мнение от OciXCrom » 22 Дек 2019, 20:34

Add these in the same section:

Код за потвърждение: Избери целия код

steam_admin = $dead_prefix$ &x04[STEAM] $admin_prefix$ &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
steam_admin_team = $dead_prefix$ ($team$) &x04[STEAM] $admin_prefix$ &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
steam_player = $dead_prefix$ &x04[STEAM] &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
steam_player_team = $dead_prefix$ ($team$) &x04[STEAM] &x01[&x04$rank$&x01] &x03$custom_name$ &x01: $chat_color$$message$
And use this:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <chatmanager>

#if !defined MAX_PLAYERS
	const MAX_PLAYERS = 32
#endif

new bool:g_bIsSteam[MAX_PLAYERS + 1]

public plugin_init()
{
	register_plugin("CM: Steam Prefix", "1.0", "OciXCrom")
}

public client_authorized(id)
{
	g_bIsSteam[id] = is_user_steam(id)

	if(g_bIsSteam[id])
	{
		cm_on_player_data_updated(id)
	}
}

public cm_on_player_data_updated(id)
{
	if(g_bIsSteam[id])
	{
		new szPrefix[8]
		cm_get_user_prefix(id, szPrefix, charsmax(szPrefix))

		if(szPrefix[0])
		{
			cm_set_user_say_format(id, "steam_admin", "steam_admin_team")
		}
		else
		{
			cm_set_user_say_format(id, "steam_player", "steam_player_team")
		}
	}
}

bool:is_user_steam(id)
{
	static iPointer

	if(iPointer || (iPointer = get_cvar_pointer("dp_r_id_provider")))
	{
		server_cmd("dp_clientinfo %d", id)
		server_exec()

		return get_pcvar_num(iPointer) == 2
	}

	return false
}

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 22 Дек 2019, 22:09

I think you can closed for now this thread ;)

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 10 госта