Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

VArtz - zdjęcie

VArtz

Rejestracja: 29.08.2015
Aktualnie: Nieaktywny
Poza forum Ostatnio: 18.09.2015 00:08
-----

#711901 Dostawanie smoke po 6 sekundach [VIP]

Napisane przez StoDwaJeden w 17.09.2015 22:52

http://amxx.pl/kompi...50&fname=Sg.sma
  • +
  • -
  • 1


#711002 Czerwony prefix [Owner] przed nickiem

Napisane przez Asiap w 29.08.2015 03:22

#include <amxmodx>

new g_iMsgSayText;

public plugin_init()
{
	g_iMsgSayText = get_user_msgid("SayText");

	register_event("SayText", "EventSayText", "bc", "2&#Cstrike_Chat_");
}

public EventSayText(iReceiver)
{
	static iSender;
	if(!(get_user_flags((iSender = read_data(1))) & ADMIN_IMMUNITY))
	{
		return PLUGIN_CONTINUE;
	}

	static szChannel[32], szMessage[256], szName[32], szBuffer[64];
	read_data(2, szChannel, 31);
	read_data(4, szMessage, 255);

	copy(szBuffer, 63, "^3[Owner]");
	if(equal(szChannel, "#Cstrike_Chat_All"))
	{
		add(szBuffer, 63, " %s1^1 :  %s2");
	}
	else
	{
		add(szBuffer, 63, " ");
		add(szBuffer, 63, szChannel);
	}

	get_user_name(iSender, szName, 31);

	emessage_begin(MSG_ONE, g_iMsgSayText, _, iReceiver);
	ewrite_byte(iSender);
	ewrite_string(szBuffer);
	ewrite_string(szName);
	ewrite_string(szMessage);
	emessage_end();
	return PLUGIN_HANDLED;
}

nie testowane ale powinno dzialac
 
 
lub

#include <amxmodx>

public plugin_init()
{
	register_message(get_user_msgid("SayText"), "MsgSayText");
}

public MsgSayText()
{
	static id;
	if(!is_user_connected((id = get_msg_arg_int(1))) || !(get_user_flags(id) & ADMIN_IMMUNITY))
	{
		return;
	}

	static szChannel[32], szBuffer[256];
	get_msg_arg_string(2, szChannel, 31);

	copy(szBuffer, 255, "^3[Owner] "); // musi byc spacja na koncu!
	add(szBuffer, 255, equal(szChannel, "#Cstrike_Chat_All") ? "%s1^1 :  %s2" : szChannel);
	set_msg_arg_string(2, szBuffer);
}

  • +
  • -
  • 1