←  Problemy z pluginami

AMXX.pl: Support AMX Mod X i SourceMod

»

Problem z pluginem flesz kolor hud

nowy22 - zdjęcie nowy22 12.08.2014

Nie wiem jak zmienić kod sma ,żeby uzyskać taki efekt pluginu

 

Potrzebny efekt:

 

[-Flesz-] Zostales oslepiony przez | %s |

 

[-Flesz-] Oslepiles | %s |

 

Słowa 

 

"Zostales oslepiony przez"

"Oslepiles"

 

nie wiem jak zrobić żeby wyżej wymienione słowa były w zwykłym kolorze hud?

 

SMA:

/* 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, "^x04[-Flesz-]^x03 Zostales oslepiony przez | %s |", name)
            print_that(id, message)            
            
            get_user_name(id, name, 32)            
            formatex(message, 127, "^x04[-Flesz-]^x03 Oslepiles | %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 }
*/

 

 

 

 

 

Odpowiedz

  • +
  • -
Wielkie Jol - zdjęcie Wielkie Jol 14.08.2014

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
 
#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, "[-Flesz-] Zostales oslepiony przez | %s |", name)
print_that(id, message)         
 
get_user_name(id, name, 32)
formatex(message, 127, "[-Flesz-] Oslepiles | %s |", name)
print_that(g_flasher, message)
}
}    
} 
 
stock print_that(id, text[])
{
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(id, text)
}
Odpowiedz

  • +
  • -
radim - zdjęcie radim 14.08.2014

Raczej:

Spoiler


@up
Nie wiem po co zamieniłeś na hudmessage lol  :o

Odpowiedz

  • +
  • -
Wielkie Jol - zdjęcie Wielkie Jol 14.08.2014

@up

 

Zasugerowałem się tym:

nie wiem jak zrobić żeby wyżej wymienione słowa były w zwykłym kolorze hud?

Czyli, chce, żeby to było w hudzie, czyż nie?

 

@down Nie wiem, zrobi jak uważa, ma do wyboru do koloru, ja pomyślałem, że chce, by to było wyświetlone w hudzie.

Odpowiedz

  • +
  • -
radim - zdjęcie radim 14.08.2014

Podał efekt jak chce osiągnąć. Flesh na zielony kolor, nick na kolor teamu a reszta na zwykły kolor, a trójkolorowego koloru w zwykłym hud nie da się osiągnąć. A autor chyba miał na myśli "zwykły kolor say'a", przynajmniej ja tak to odebrałem uwzględniając jaki efekt chciał osiągnąć.

Odpowiedz

nowy22 - zdjęcie nowy22 17.08.2014

"zwykły kolor say'a" tak kolor saya

Odpowiedz