Page 1 of 2

modificare mesaj hud

Posted: 15 Jul 2012, 00:48
by smileye
Vreau sa imi modificati sursa de mai jos care apar mesajele in hud sa arate doar la cei vii,dupa ce mor sa nu le mai apara.
| Afiseaza codul
#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	SyncHudMessage = CreateHudSyncObj( );
	
	set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
	new Players[32], iNum;
	get_players(Players, iNum, "ch")
	
	new current_map[32]
        get_mapname(current_map, 31)
 
	new timeleft = get_timeleft( )
	
	for( new i = 0; i < iNum; i++ )
	{
		set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
		ShowSyncHudMsg(0, SyncHudMessage, "| Timeleft: %d:%02d | http://www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
	}
}

Re: modificare mesaj

Posted: 15 Jul 2012, 01:05
by CamPagNe
Vezi, nu stiu daca merge, dar fa o proba :D
SMA | Afiseaza codul
#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	SyncHudMessage = CreateHudSyncObj( );
	
	set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
	new Players[32], iNum;
	get_players(Players, iNum, "ch")
	
	new current_map[32]
        get_mapname(current_map, 31)
 
	new timeleft = get_timeleft( )
	
	for( new i = 0; i < iNum; i++ )
	{
		if (!is_user_alive(id))
		return PLUGIN_HANDLED;	
		
                else
                {
		set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
		ShowSyncHudMsg(0, SyncHudMessage, "| Timeleft: %d:%02d | http://www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
                 }
	}
}

Re: modificare mesaj

Posted: 15 Jul 2012, 14:05
by smileye
/tmp/textL3tDtI.sma(33) : error 017: undefined symbol "id"
/tmp/textL3tDtI.sma(42) : warning 209: function "ShowMessage" should return a value

nici nu se compileaza de la ceea ce ai adaugat,poate nu e tot codul

Re: modificare mesaj

Posted: 15 Jul 2012, 14:12
by K1d0x
Poftim !
| Afiseaza codul
#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	SyncHudMessage = CreateHudSyncObj( );
	
	set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
	new Players[32], iNum;
	get_players(Players, iNum, "ach")
	
	new current_map[32]
        get_mapname(current_map, 31)
 
	new timeleft = get_timeleft( )
	
	for( new i = 0; i < iNum; i++ )
	{
		set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
		ShowSyncHudMsg(0, SyncHudMessage, "| Timeleft: %d:%02d | www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
	}
}

Re: modificare mesaj

Posted: 15 Jul 2012, 14:50
by smileye
tot apare mesajul in hud cand is mort

Re: modificare mesaj

Posted: 15 Jul 2012, 16:58
by Andrew
pai poate ai ghostchax.amxx , daca il ai du-te in amxx.cfg si punei ; in fata

Re: modificare mesaj

Posted: 15 Jul 2012, 17:39
by smileye
asta nu are treaba cu ghostchat :| e un mesaj in hud te-ai uitat pe sma sa vezi?

Re: modificare mesaj

Posted: 15 Jul 2012, 17:49
by KronoS eXtream
Salut!
| Afiseaza codul
#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	SyncHudMessage = CreateHudSyncObj( );
	
	set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
	new Players[32], iNum;
	get_players(Players, iNum, "ach")
	
	new current_map[32]
        get_mapname(current_map, 31)
 
	new timeleft = get_timeleft( )
	
	for( new i = 0; i < iNum; i++ )
	{
		set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
		ShowSyncHudMsg(i, SyncHudMessage, "| Timeleft: %d:%02d | www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
	}
}

Re: modificare mesaj hud

Posted: 15 Jul 2012, 19:24
by smileye
ai un thanks,spune-mi te rog si ce ai adaugat in loc de ch trebuia ach?

EDIT: Tot nu merge.

Re: modificare mesaj hud

Posted: 15 Jul 2012, 20:09
by KronoS eXtream
Da + ca mesajul era trimis global :)

Ia vezi asa:
| Afiseaza codul
#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	SyncHudMessage = CreateHudSyncObj( );
	
	set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
	static id
	
	new current_map[32]
        get_mapname(current_map, 31)
 
	new timeleft = get_timeleft()

	for(id = 1; id <= get_maxplayers(); id++)
	{
		if(is_user_alive(id))
		{
			set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 );
			ShowSyncHudMsg(id, SyncHudMessage, "| Timeleft: %d:%02d | www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
		}
	}
}

Re: modificare mesaj hud

Posted: 15 Jul 2012, 21:30
by smileye
acum merge,dar ar mai fi o problema la afisare,cum as putea sa ii pun un random la mesaj sa apara mai lucios cumva sa sclipeasca,nu RGB ca apare prea pe alb sa fie un fel de alb spre gri,este un cod

Re: modificare mesaj hud

Posted: 15 Jul 2012, 22:37
by KronoS eXtream
Am schimbat culoarea (am innegrit albul) si am bagat efectul :)
| Afiseaza codul
#include <amxmodx>

static const PLUGIN[ ]= "Details Server";
static const VERSION[ ]= "1.0";
static const AUTHOR[ ]= "Power";

static const g_szB[ ]= "b";


new SyncHudMessage;

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	SyncHudMessage = CreateHudSyncObj( );
	
	set_task( 1.0, "ShowMessage", _, _, _, g_szB );
}

public ShowMessage( )
{
	static id
	
	new current_map[32]
        get_mapname(current_map, 31)
 
	new timeleft = get_timeleft()

	for(id = 1; id <= get_maxplayers(); id++)
	{
		if(is_user_alive(id))
		{
			set_hudmessage(200, 200, 200, -1.0, 0.02, 1, 0.0, 1.0, 0.0, 1.0, 3 );
			ShowSyncHudMsg(id, SyncHudMessage, "| Timeleft: %d:%02d | www.forum.ro | Harta: %s |", timeleft / 60, timeleft % 60, current_map);
		}
	}
}