Add Steam Prefix in Chat Menager

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

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 05 Дек 2019, 20:59

Hello who can help me to add Steam Prefix when somebody write in server to show automaticly if using Steam i mean for viewtopic.php?f=21&p=9234 - OciXCrom Plugin ?

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

Add Steam Prefix in ChanMenager

Мнение от OciXCrom » 05 Дек 2019, 21:07

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

#include <amxmodx>
#include <chatmanager>

#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)
	}
}

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 » 05 Дек 2019, 21:11

Thanks OciXCrom very much ;)

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

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 19 Дек 2019, 19:49

Hello OciXCrom when i test dont work do you know why and i have and other idea do you know to edit you plugin to add and some bonuses for steam to take money 2000 every round, vip free to have acces for vip and to have prefix [Steam]

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

Add Steam Prefix in Chat Menager

Мнение от OciXCrom » 19 Дек 2019, 21:07

The plugin gives the prefix only for Steam players who have bought the game, not cracked Steam. Is this what you wanted and tested?

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

Add Steam Prefix in Chat Menager

Мнение от lantimilan » 19 Дек 2019, 21:08

i test your first version with steam official not carcked and not show prefix

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

Add Steam Prefix in Chat Menager

Мнение от atmax » 20 Дек 2019, 19:40

Try this, but I'm not sure is it work.

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

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <chatmanager>

#if AMXX_VERSION_NUM < 183
    #include <dhudmessage>
#endif 

#pragma semicolon	1

#define PLUGIN	"Steam Prefix + Bonus"
#define VERSION	"1.0"
#define AUTHOR	"aTmAx"
#define PREFIX	"[STEAM Bonus]"


#define get_bit(%1,%2)	(%1 & (1 << (%2 & 31)))
#define set_bit(%1,%2)	(%1 |= (1 << (%2 & 31)))
#define reset_bit(%1,%2)	(%1 &= ~(1 << (%2 & 31)))

//DHUD poruka
#define COLOR_RED	random(255)	// Red
#define COLOR_GREEN	random(255) // Green
#define COLOR_BLUE	random(255)	// Blue

#define TIME	5.0	// Time to show
#define STEAM_PREFIX "&x04[Steam]"
#define NUM_MONEY	2000	// How much money to give?

new g_bIsConnected;
new g_bIsSteam;
new g_bProcedure;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	RegisterHam(Ham_CS_RoundRespawn, "player", "fw_CS_RoundRespawn_Post", true);
}
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)
	}
}

public client_putinserver(id)
{
	set_bit(g_bIsConnected, id);
	
	if(is_user_steam(id))
	{
		set_bit(g_bIsSteam, id);
		reset_bit(g_bProcedure, id);
		set_task(3.0, "WelcomeMessage", id);
	}
	else
		reset_bit(g_bIsSteam, id);
}

public client_disconnected(id)
	reset_bit(g_bIsConnected, id);

public WelcomeMessage(id)
{
	if(get_bit(g_bIsConnected, id))
	{
		static szName[32];
		get_user_name(id, szName, charsmax(szName));
		
		set_dhudmessage(COLOR_RED, COLOR_GREEN, COLOR_BLUE, -1.0, 0.3, 0, 0.0, TIME);
		show_dhudmessage(id, "Greetings!, %s!", szName);
		set_dhudmessage(COLOR_RED, COLOR_GREEN, COLOR_BLUE, -1.0, 0.34, 0, 0.0, TIME);
		show_dhudmessage(id, "You are using STEAM, so every round you will get a BONUS!");
	}
}

public fw_CS_RoundRespawn_Post(id)
{
	if(get_bit(g_bIsConnected, id) && get_bit(g_bIsSteam, id))
	{
		if(!get_bit(g_bProcedure, id))
		{
			cs_set_user_money(id, cs_get_user_money(id) + NUM_MONEY);
			client_print_color(id, print_team_red, "^3%s ^1You get a bonus: ^4'%d$'", PREFIX, NUM_MONEY);
			set_bit(g_bProcedure, id);
		}
		
	}
}

stock bool:is_user_steam(id)
{
	static dp_pointer;
	
	if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
	{
		server_cmd("dp_clientinfo %d", id);
		server_exec();
		return (get_pcvar_num(dp_pointer) == 2) ? true : false;
	}
	
	new szAuthid[34];
	get_user_authid(id, szAuthid, charsmax(szAuthid));
	
	return (containi(szAuthid, "LAN") < 0);
}
Rest in peace my friend I always will remember you! 🖤👊

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

Add Steam Prefix in Chat Menager

Мнение от mi0 » 20 Дек 2019, 23:48

The plugin should be working fine unless you are using ReHLDS and its extension ReUnion. If so you might want to use is_user_steam(index) included in ReAPI insted of using dproto's checking method.
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 » 21 Дек 2019, 12:42

OciXCrom i have ReHlds and Reapi have any solution for this plugin ?

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

Add Steam Prefix in Chat Menager

Мнение от atmax » 21 Дек 2019, 14:17

https://dox.abv.bg/download?id=56afbcbe23#
Here we go.. i tried so many ways.. There is 5 plugin's to try when u find your plugin compile it. But before that do this settings in source code:

#define STEAM_PREFIX "&x04[STEAM]"
#define NUM_MONEY 2000
The first one is Prefix and second is how much money to give.
Rest in peace my friend I always will remember you! 🖤👊

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

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

Кой е на линия

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