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
 

Zdjęcie

join_leave


  • Zamknięty Temat jest zamknięty
1 odpowiedź w tym temacie

#1 ord23

    Początkujący

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:10
Offline

Napisano 23.08.2008 12:04

Witam
Mam takie pytanie, czy da sie przerobic plugin join_leave tak aby wyswietlal teksty takie jakie bym chial? Probowalem przerabiac ten plugin, ale niestety mi nie wyszlo plugin dalej pokazywal to co bylo domyslne.
proszę o pomoc, z gory dzięki pozdrawiam
Oto .sma z moja przerobka:


/*
Join/Leave Message 1.2 by BigBaller

Just shows a basic Tsay like message to all players when user
is connecting, has established connection and disconnected from your server.

Just upload into your amxx/plugins folder
Add join_leave.amx in your amxx/plugins.ini

Restart server or change map.

ENJOY!

*New, You are able to turn messages off and on using the cvar
amx_join_leave

1 = On
0 = Off

Plugin by default is 1

Change Log
v 1.0 - Started with basic messages.
v 1.1 - Created a cvar to disable messages (cvar is amx_join_leave 1|0)
v 1.2 - Moved the messages up, they conflicted with plugins such as StatsX and PTB
*/

#include <amxmodx>

public plugin_init() {
  register_plugin("Join/Leave Message","1.2","BigBaller")
  register_cvar("amx_join_message", "Przychodzi %name% Serdecznie witamy!")
  register_cvar("amx_joined_message", "%name% jest gotowy! Zyczymy milej gry")
  register_cvar("amx_leave_message", "Odchodzi %name% Nareczka i pozdro!")
  register_cvar("amx_join_leave","1")
}

public client_connect(id){
	new user[32], len
	user[0] = id
	len = get_user_name(id,user[1],31)
	set_task(2.0, "join_msg", 0, user,len + 2)
	return PLUGIN_CONTINUE
}

public client_putinserver(id){
	new user[32], len
	user[0] = id
	len = get_user_name(id,user[1],31)
	set_task(2.0, "joined_msg", 0, user,len + 2)
	return PLUGIN_CONTINUE
}

public client_disconnect(id){
	new user[32], len
	user[0] = id
	len = get_user_name(id, user[1], 31)
	set_task(2.0, "leave_msg", 0, user, len + 2)
	return PLUGIN_CONTINUE
}

public join_msg(user[]) {
        if (get_cvar_num("amx_join_leave")==0){
        return PLUGIN_HANDLED
        }
	if (get_cvar_num("amx_join_leave")==1){
	new message[192]
	get_cvar_string("amx_join_message", message, 191)
	replace(message, 191, "%name%", user[1])
	set_hudmessage(0, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)
	show_hudmessage(0, message)
	return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public joined_msg(user[]) {
        if (get_cvar_num("amx_join_leave")==0){
        return PLUGIN_HANDLED
        }
	if (get_cvar_num("amx_join_leave")==1){
	new message[192]
	get_cvar_string("amx_joined_message", message, 191)
	replace(message, 191, "%name%", user[1])
	set_hudmessage(0, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)
	show_hudmessage(0, message)
	return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public leave_msg(user[]) {
        if (get_cvar_num("amx_join_leave")==0){
        return PLUGIN_HANDLED
        }
	if (get_cvar_num("amx_join_leave")==1){
	new message[192]
	get_cvar_string("amx_leave_message", message, 191)
	replace(message, 191, "%name%", user[1])
	set_hudmessage(0, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)
	show_hudmessage(0, message)
	return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

  • +
  • -
  • 0

#2 Gość__*

  • Gość

Reputacja: 0

Offline

Napisano 23.08.2008 13:38

public plugin_init() {
register_plugin("Join/Leave Message","1.2","BigBaller")
register_cvar("amx_join_message", "Przychodzi %name% Serdecznie witamy!")
register_cvar("amx_joined_message", "%name% jest gotowy! Zyczymy milej gry")
register_cvar("amx_leave_message", "Odchodzi %name% Nareczka i pozdro!")
register_cvar("amx_join_leave","1")
}

Zmień tu na swoje.




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych