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
 

momo - zdjęcie

momo

Rejestracja: 04.12.2009
Aktualnie: Nieaktywny
Poza forum Ostatnio: 24.04.2013 13:38
-----

#198972 Vip dr pomoc help

Napisane przez Agent w 23.12.2010 19:38

/* Uwaga: Wykorzystano kod z pluginu zm_vip na pokazanie vipow online */

#include <amxmodx>

#define PLUGIN "VIP STATUS"
#define VERSION "1.0"
#define AUTHOR "Agent"

#define VIPACCES ADMIN_RESERVATION

new const
	VIP_STATUS[] = "VIPY ONLINE: ",
	VIP_STATUS_N[] = "Brak"

new maxplayers, g_msgSayText

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR)

	maxplayers = get_maxplayers()
	g_msgSayText = get_user_msgid("SayText")

	register_clcmd("say /vips", "print_adminlist")
	register_clcmd("say /vipsinfo", "ShowMotd")
}

public client_putinserver(id) 
{ 
	new name[32]
	if(get_user_flags(id) & VIPACCES) 
	{ 
		get_user_name(id,name,32)
		client_print(0, print_chat,"%s - Witamy!", name)
	} 
}

public print_adminlist(user) //fragemnt kodu z zm_vip (zmodyfikowany)
{
	new adminnames[33][32]
	new message[256]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & VIPACCES)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, VIP_STATUS)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				client_printcolor(user, "/g%s", message)
				len = format(message, 255, "")
			}
		}
		client_printcolor(user, "/g%s", message)
	}
	else {
		len += format(message[len], 255-len, VIP_STATUS_N)
		client_printcolor(user, "/g%s", message)
	}
		
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt") // Lokalizacja pliku: cstrike/vip.txt
}

stock client_printcolor(const id, const input[], any:...)
{
	
	new iCount = 1, iPlayers[32]
	
	static szMsg[191]
	vformat(szMsg, charsmax(szMsg), input, 3)
	
	replace_all(szMsg, 190, "/g", "^4") // green txt
	replace_all(szMsg, 190, "/y", "^1") // orange txt
	replace_all(szMsg, 190, "/ctr", "^3") // team txt
	replace_all(szMsg, 190, "/w", "^0") // team txt
	
	if(id) iPlayers[0] = id
	else get_players(iPlayers, iCount, "ch")
		
	for (new i = 0; i < iCount; i++)
	{
		if (is_user_connected(iPlayers[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
			write_byte(iPlayers[i])
			write_string(szMsg)
			message_end()
		}
	}
}

Powinno być OK. Daj znać jak coś
  • +
  • -
  • 1