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
Nowy Plugin

[Pugin] Wybór Interpu [Edycja]Pomocy!

Nowy Plugin

  • Zamknięty Temat jest zamknięty
6 odpowiedzi w tym temacie

#1 Zuraw1221

    Nowy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:6
  • Imię:Patryk
  • Lokalizacja:Łódź
Offline

Napisano 10.07.2011 09:39

Witam Użytkowników!

Chciałbym prosić was o pomoc. Ponieważ mam pewien problem. Chciałbym edytować plugin "wybór interpu" ,ale nie wiem jak.
Proszę was o pomoc.

Chciałbym zmienić w nim to ,że w sayu text który pisze po zmianie interpu wyglądał tak:

w CT:
[Interp] SilveR ustawil ex_interp na 0.01
w TT:
[Interp] SilveR ustawil ex_interp na 0.01
i tak przy każdym innym interpie.
Chcę po prostu zmienić kolory. Pewnie dla was to dziecinna zabawa, ale dla mnie pisanie pluginów to czarna magia :D

Z góry dziękuję.

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Wybor Interpu"
#define VERSION "1.0"
#define AUTHOR ""

#define TASK_SHOWMENU 432

#define MYMENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_menu("InterpASK", MYMENU_KEYS, "InterpASK_Handler")
}
public client_putinserver(id)
{
	if(!is_user_bot(id))
		eventInGame(id)
}
public show_menu_(tid)
{
	new id=tid-TASK_SHOWMENU;
	new iTeam=get_user_team(id)
	new menu_id, keys;
	new menuUp = player_menu_info( id, menu_id, keys )
	if ( iTeam && (menuUp <= 0 || menu_id < 0) )
		SMenu(id)
	else
		set_task(1.0, "show_menu_", tid)
}
public eventInGame(id) set_task(1.0, "show_menu_", id+TASK_SHOWMENU);

public SMenu(id)
{
	new menu_body[512]
	format(menu_body, 511, "\wWybierz wartosc ex_interp^n^n\r1\y. \w ex_interp - 0.01^n\r2\y. \w ex_interp - 0.02^n\r3\y. \w ex_interp - 0.03")
		
	show_menu(id, MYMENU_KEYS, menu_body, -1, "InterpASK")
}

public InterpASK_Handler(id, key)
{
	new name[32]
	get_user_name(id, name, 31)
	switch(key)
	{
		case 0:{
			client_cmd(id, "ex_interp 0.01")
			client_print(id, print_chat, "[Interp]^"%s^" ustawil ex_interp na 0.01", name)
		}
		case 1:{
			client_cmd(id, "ex_interp 0.02")
			client_print(id, print_chat, "[Interp] ^"%s^" ustawil ex_interp na 0.02", name)
		}
		case 2:{
			client_cmd(id, "ex_interp 0.03")
			client_print(id, print_chat, "[Interp] ^"%s^" ustawil ex_interp na 0.03", name)
		}
	}
	return PLUGIN_CONTINUE;
}

Użytkownik Zuraw1221 edytował ten post 10.07.2011 09:41

  • +
  • -
  • 0

#2 MieTeK_

    Profesjonalista

  • Użytkownik

Reputacja: 308
Wszechpomocny

  • Postów:185
  • Imię:Wheatley
Offline

Napisano 10.07.2011 09:49

powinno działać :)

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Wybor Interpu"
#define VERSION "1.0"
#define AUTHOR ""

#define TASK_SHOWMENU 432

#define MYMENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menu("InterpASK", MYMENU_KEYS, "InterpASK_Handler")
}
public client_putinserver(id)
{
if(!is_user_bot(id))
eventInGame(id)
}
public show_menu_(tid)
{
new id=tid-TASK_SHOWMENU;
new iTeam=get_user_team(id)
new menu_id, keys;
new menuUp = player_menu_info( id, menu_id, keys )
if ( iTeam && (menuUp <= 0 || menu_id < 0) )
SMenu(id)
else
set_task(1.0, "show_menu_", tid)
}
public eventInGame(id) set_task(1.0, "show_menu_", id+TASK_SHOWMENU);

public SMenu(id)
{
new menu_body[512]
format(menu_body, 511, "\wWybierz wartosc ex_interp^n^n\r1\y. \w ex_interp - 0.01^n\r2\y. \w ex_interp - 0.02^n\r3\y. \w ex_interp - 0.03")

show_menu(id, MYMENU_KEYS, menu_body, -1, "InterpASK")
}

public InterpASK_Handler(id, key)
{
new name[32]
get_user_name(id, name, 31)
switch(key)
{
case 0:{
client_cmd(id, "ex_interp 0.01")
ColorChat(id, GREEN, "[Interp]^3^"%s^" ^1ustawil ex_interp na 0.01", name)
}
case 1:{
client_cmd(id, "ex_interp 0.02")
ColorChat(id, GREEN, "[Interp]^3 ^"%s^" ^1ustawil ex_interp na 0.02", name)
}
case 2:{
client_cmd(id, "ex_interp 0.03")
ColorChat(id, GREEN, "[Interp]^3 ^"%s^" ^1ustawil ex_interp na 0.03", name)
}
}
return PLUGIN_CONTINUE;
}

  • +
  • -
  • 0

#3 kapi10072

    Wszechpomocny

  • Użytkownik

Reputacja: 70
Pomocny

  • Postów:318
  • Steam:steam
  • Imię:Kacper
  • Lokalizacja:Polska
Offline

Napisano 10.07.2011 19:34

Mała poprawka w define.

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Wybor Interpu"
#define VERSION "1.0"
#define AUTHOR ""

#define TASK_SHOWMENU 432

#define MYMENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menu("InterpASK", MYMENU_KEYS, "InterpASK_Handler")
}
public client_putinserver(id)
{
if(!is_user_bot(id))
eventInGame(id)
}
public show_menu_(tid)
{
new id=tid-TASK_SHOWMENU;
new iTeam=get_user_team(id)
new menu_id, keys;
new menuUp = player_menu_info( id, menu_id, keys )
if ( iTeam && (menuUp <= 0 || menu_id < 0) )
SMenu(id)
else
set_task(1.0, "show_menu_", tid)
}
public eventInGame(id) set_task(1.0, "show_menu_", id+TASK_SHOWMENU);

public SMenu(id)
{
new menu_body[512]
format(menu_body, 511, "\wWybierz wartosc ex_interp^n^n\r1\y. \w ex_interp - 0.01^n\r2\y. \w ex_interp - 0.02^n\r3\y. \w ex_interp - 0.03")

show_menu(id, MYMENU_KEYS, menu_body, -1, "InterpASK")
}

public InterpASK_Handler(id, key)
{
new name[32]
get_user_name(id, name, 31)
switch(key)
{
case 0:{
client_cmd(id, "ex_interp 0.01")
ColorChat(id, GREEN, "[Interp]^3^"%s^" ^1ustawil ex_interp na 0.01", name)
}
case 1:{
client_cmd(id, "ex_interp 0.02")
ColorChat(id, GREEN, "[Interp]^3 ^"%s^" ^1ustawil ex_interp na 0.02", name)
}
case 2:{
client_cmd(id, "ex_interp 0.03")
ColorChat(id, GREEN, "[Interp]^3 ^"%s^" ^1ustawil ex_interp na 0.03", name)
}
}
return PLUGIN_CONTINUE;
}


Mam nawet taki plugin, to mi błędy robi..
  • +
  • -
  • 0

Dołączona grafika
Najlepszy serwer TeamPlay w Polsce !
Pomogłem, wejdź ;)
Zapraszam na BHZ-Game.pl
Bo nie liczą się fragi tylko dobra atmosfera ;D


#4 Gość_deLL_*

  • Gość

Reputacja: 0

Offline

Napisano 10.07.2011 19:40

Jakie ^3 itp... ?

#include <amxmisc>
#include <ColorChat>

#define PLUGIN "Wybor Interpu"
#define VERSION "1.0"
#define AUTHOR "Nieznany?"

#define TASK_SHOWMENU 432

#define MYMENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menu("InterpASK", MYMENU_KEYS, "InterpASK_Handler")
}
public client_putinserver(id)
{
if(!is_user_bot(id))
eventInGame(id)
}
public show_menu_(tid)
{
new id=tid-TASK_SHOWMENU;
new iTeam=get_user_team(id)
new menu_id, keys;
new menuUp = player_menu_info( id, menu_id, keys )
if ( iTeam && (menuUp <= 0 || menu_id < 0) )
SMenu(id)
else
set_task(1.0, "show_menu_", tid)
}
public eventInGame(id) set_task(1.0, "show_menu_", id+TASK_SHOWMENU);

public SMenu(id)
{
new menu_body[512]
format(menu_body, 511, "\wWybierz wartosc ex_interp^n^n\r1\y. \w ex_interp - 0.01^n\r2\y. \w ex_interp - 0.02^n\r3\y. \w ex_interp - 0.03")

show_menu(id, MYMENU_KEYS, menu_body, -1, "InterpASK")
}

public InterpASK_Handler(id, key)
{
new name[32]
get_user_name(id, name, 31)
switch(key)
{
case 0:{
client_cmd(id, "ex_interp 0.01")
ColorChat(id, GREEN, "^x04 [Interp]^x03 %s^x01 ustawil ex_interp na 0.01", name)
//client_print(id, print_chat, "[Interp]^"%s^" ustawil ex_interp na 0.01", name)
}
case 1:{
client_cmd(id, "ex_interp 0.02")
ColorChat(id, GREEN, "^x04 [Interp]^x03 %s^x01 ustawil ex_interp na 0.02", name)
//client_print(id, print_chat, "[Interp] ^"%s^" ustawil ex_interp na 0.02", name)
}
case 2:{
client_cmd(id, "ex_interp 0.03")
ColorChat(id, GREEN, "^x04 [Interp]^x03 %s^x01 ustawil ex_interp na 0.03", name)
//client_print(id, print_chat, "[Interp] ^"%s^" ustawil ex_interp na 0.03", name)
}
}
return PLUGIN_CONTINUE;
}

Użytkownik deLL edytował ten post 10.07.2011 19:40


#5 MieTeK_

    Profesjonalista

  • Użytkownik

Reputacja: 308
Wszechpomocny

  • Postów:185
  • Imię:Wheatley
Offline

Napisano 11.07.2011 07:48

Jakie ^3 itp... ?


Można używać ^1 zamist ^x01 , tak nawet pisze w dokumentacji :)
  • +
  • -
  • 0

#6 sharkowy

    Lokalna anomalia sejsmiczna o nieustalonej genezie.

  • Przyjaciel

Reputacja: 113
Zaawansowany

  • Postów:1 981
Offline

Napisano 11.07.2011 11:13

Nie potrzebnie zakomentowałeś printa skoro ma być zastąpiony color chatem :P

#include <amxmisc>
#include <ColorChat>

#define PLUGIN "Wybor Interpu"
#define VERSION "1.0"
#define AUTHOR "Nieznany?"

#define TASK_SHOWMENU 432

#define MYMENU_KEYS MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menu("InterpASK", MYMENU_KEYS, "InterpASK_Handler")
}
public client_putinserver(id)
{
if(!is_user_bot(id))
eventInGame(id)
}
public show_menu_(tid)
{
new id=tid-TASK_SHOWMENU;
new iTeam=get_user_team(id)
new menu_id, keys;
new menuUp = player_menu_info( id, menu_id, keys )
if ( iTeam && (menuUp <= 0 || menu_id < 0) )
SMenu(id)
else
set_task(1.0, "show_menu_", tid)
}
public eventInGame(id) set_task(1.0, "show_menu_", id+TASK_SHOWMENU);

public SMenu(id)
{
new menu_body[512]
format(menu_body, 511, "\wWybierz wartosc ex_interp^n^n\r1\y. \w ex_interp - 0.01^n\r2\y. \w ex_interp - 0.02^n\r3\y. \w ex_interp - 0.03")

show_menu(id, MYMENU_KEYS, menu_body, -1, "InterpASK")
}

public InterpASK_Handler(id, key)
{
new name[32]
get_user_name(id, name, 31)
switch(key)
{
case 0:{
client_cmd(id, "ex_interp 0.01")
ColorChat(id, GREEN, "^x04 [Interp]^x03 %s^x01 ustawil ex_interp na 0.01", name)
}
case 1:{
client_cmd(id, "ex_interp 0.02")
ColorChat(id, GREEN, "^x04 [Interp]^x03 %s^x01 ustawil ex_interp na 0.02", name)
}
case 2:{
client_cmd(id, "ex_interp 0.03")
ColorChat(id, GREEN, "^x04 [Interp]^x03 %s^x01 ustawil ex_interp na 0.03", name)
}
}
return PLUGIN_CONTINUE;
}



Ładniej wygląda ^^
  • +
  • -
  • 0

#7 Gość_deLL_*

  • Gość

Reputacja: 0

Offline

Napisano 11.07.2011 15:10

Jakie ^3 itp... ?


Można używać ^1 zamist ^x01 , tak nawet pisze w dokumentacji :)


Zauważ że tam jest to "małym druczkiem" więc nie zawsze może działać...





Również z jednym lub większą ilością słów kluczowych: Nowy Plugin

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

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