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

Zastosowanie colorchatu


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

#1 'eXe'

    Profesjonalista

  • Zbanowany

Reputacja: 9
Nowy

  • Postów:164
  • GG:
  • Imię:PatryQ
  • Lokalizacja:Czeladz
Offline

Napisano 16.08.2014 12:53

Witam,

 

Mam problem z zastosowaniem colorchatu w tym plugine:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Flash Snitch"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define ID 3322

new msg_saytext
new g_flasher

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    msg_saytext = get_user_msgid("SayText")
    
    register_event("ScreenFade", "ScreenFade", "be", "4=255", "5=255", "6=255", "7>199") 
    register_event("23", "TEMPENTITY", "a", "1=5", "6=25", "7=6") 
    
    register_forward(FM_SetModel, "SetModel") 
}


public SetModel(ent, model[]) 
{    
    if(equal(model, "models/w_flashbang.mdl")) 
    {    
        static owner
        owner = pev(ent, pev_owner)
        if(owner)         
        {
            set_task(1.52,"get_flasher", ID + owner)
        }
    }
} 

public TEMPENTITY()
{    
    set_task(0.05, "reset_flasher") 
    return PLUGIN_CONTINUE
} 

public reset_flasher()
{ 
    g_flasher = 0
}

public get_flasher(id)
{ 
    g_flasher = (id - ID)
}

public ScreenFade(id) 
{    
    if(is_user_alive(id))
    {
        if(id != g_flasher && get_user_team(id) == get_user_team(g_flasher))
        {
            static name[33], message[128]
                        
            get_user_name(g_flasher, name, 32)            
            formatex(message, 127, "^x04de_dust2^x01 # Zostales oslepiony przez ^x03%s", name)
            print_that(id, message)            
            
            get_user_name(id, name, 32)            
            formatex(message, 127, "^x04de_dust2^x01 # Wlasnie oslepiles: ^x03%s", name)
            print_that(g_flasher, message)
        }
    }    
} 

stock print_that(id, text[])
{
    message_begin(MSG_ONE_UNRELIABLE, msg_saytext, {0,0,0}, id)
    write_byte(id)
    write_string(text)
    message_end()
}  
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

Gdy dodaje include colorchat, zamiast formatex daje ColorChat i dodaje GREEN, plugin się buguje i nie wyswietla komunikatów



#2 radim

    Godlike

  • Moderator

Reputacja: 939
Master

  • Postów:2 725
  • Steam:steam
  • Imię:Arkadiusz
  • Lokalizacja:Janów Lub.
Offline

Napisano 16.08.2014 17:28

Pokaż kod po Twoich edycjach, czyli w jaki sposób Ty to robiłeś.


  • +
  • -
  • 0

Chcąc napisać do mnie prywatną wiadomość, wpierw zapoznaj się ze stroną "O mnie" w moim profilu użytkownika [ radim ] !


#3 bamber

    Zaawansowany

  • Użytkownik

Reputacja: 4
Nowy

  • Postów:123
  • Imię:Zenek
  • Lokalizacja:warszawa
Offline

Napisano 16.08.2014 18:53

^x01 normalny
^x03 teamu
^x04 zielony 

 

^x03de_dust2^x04 # Zostales oslepiony przez ^x03%s

i będzie sie wyswietlalo

de_dust2  # Zostales oslepiony przez bamber ( czerwony lub niebieski zależy który team )


  • +
  • -
  • 0

#4 Niide

    *** it I'm done

  • Użytkownik

Reputacja: 86
Zaawansowany

  • Postów:216
  • Imię:Paweł
  • Lokalizacja:Holandia
Offline

Napisano 16.08.2014 19:02

No dobra, dałeś tutaj kolorki z ColorChat

formatex(message, 127, "^x04de_dust2^x01 # Wlasnie oslepiles: ^x03%s", name)

ale ten Twój stock nie ma nic z kolorkami...

 

Try this

/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "Flash Snitch"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define ID 3322

new g_flasher

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("ScreenFade", "ScreenFade", "be", "4=255", "5=255", "6=255", "7>199") 
	register_event("23", "TEMPENTITY", "a", "1=5", "6=25", "7=6") 
	
	register_forward(FM_SetModel, "SetModel") 
}


public SetModel(ent, model[]) 
{    
	if(equal(model, "models/w_flashbang.mdl")) 
	{    
		static owner
		owner = pev(ent, pev_owner)
		if(owner)         
		{
			set_task(1.52,"get_flasher", ID + owner)
		}
	}
} 

public TEMPENTITY()
{    
	set_task(0.05, "reset_flasher") 
	return PLUGIN_CONTINUE
} 

public reset_flasher()
{ 
	g_flasher = 0
}

public get_flasher(id)
{ 
	g_flasher = (id - ID)
}

public ScreenFade(id) 
{    
	if(is_user_alive(id))
	{
		if(id != g_flasher && get_user_team(id) == get_user_team(g_flasher))
		{
			static name[33], message[128]
			
			get_user_name(g_flasher, name, 32)            
			formatex(message, 127, "^x04de_dust2^x01 # Zostales oslepiony przez ^x03%s", name)
			ColorChat(id,GREEN, message)            
			
			get_user_name(id, name, 32)            
			formatex(message, 127, "^x04de_dust2^x01 # Wlasnie oslepiles: ^x03%s", name)
			ColorChat(g_flasher,GREEN, message)
		}
	}    
} 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

  • +
  • -
  • 1

kP8HWV.png





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

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