←  Problemy z pluginami

AMXX.pl: Support AMX Mod X i SourceMod

»

Problem z scoreboard w hud

  • +
  • -
Rellik # - zdjęcie Rellik # 03.11.2014

Próbuje ogarnąć pewien plugin na wyświetlanie w hudzie ilości graczy w danej drużynie i ile dana drużyna wygrywa... Lecz coś mi nie wychodzi, pokazuje Ct lecz TT już nie... Prosiłbym o pomoc!

 

SS:

e1ZmdFr.png

 

#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Scoreboard"
#define VERSION "1.0"
#define AUTHOR "Tester"
 
new TerrorWins
new CounterWins
 
new Terrorists
new CounterTerrorists
 
new SyncHudObj;
 
new Float:g_round_start = -1.0;
 
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
 
set_task(1.0,"HUDUpdate", 0,"",0,"b")
set_task(1.0,"HUDU", 0,"",0,"b")
 
 
SyncHudObj = CreateHudSyncObj();
 
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin") 
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
 
register_logevent("EventRoundStart", 2, "1=Round_Start");
register_logevent("EventRoundEnd", 2, "1=Round_End");
register_event("TextMsg", "EventRoundRestart", "a", "2&#Game_C", "2&#Game_w");
 
 
 
}
 
 
public HUDUpdate()
{ 
new iPlayers[32]
get_players(iPlayers, Terrorists, "ae", "TERRORIST");
get_players(iPlayers, CounterTerrorists, "ae", "CT");  
 
set_hudmessage(0, 255, 0, 0.2, 0.0, 0, 6.0, 1.0,0.0,0.1,false)
ShowSyncHudMsg(0, SyncHudObj, "Terro [%i] | [%i]", TerrorWins,Terrorists);
}
public HUDU()
{ 
new iPlayers[32]
get_players(iPlayers, Terrorists, "ae", "TERRORIST");
get_players(iPlayers, CounterTerrorists, "ae", "CT");  
 
set_hudmessage(0, 255, 0, 0.6, 0.0, 0, 6.0, 1.0,0.0,0.1,false)
ShowSyncHudMsg(0, SyncHudObj, "[%i] | [%i] CTerro", CounterTerrorists,CounterWins);
}
 
public t_win()
{
TerrorWins++
}
 
public ct_win()
{
CounterWins++
}
public EventRoundEnd()
{
g_round_start = -1.0;
}
 
public EventRoundRestart()
{
g_round_start = -1.0;
}
 

 

Odpowiedz

  • +
  • -
Rellik # - zdjęcie Rellik # 04.11.2014

Nie mogę edytować... Ogólnie chodzi mi o to, że nie pokazuje hudu terro... Nie wiem co robie źle.. proszę o szybką pomoc. :/ W kodzie nie ma chyba błędu  :crazy: nie jestem zaawansowany więc piszę o pomoc.


Użytkownik FR_Rellik edytował ten post 04.11.2014 15:02
Odpowiedz

  • +
  • -
Dziobak? - zdjęcie Dziobak? 11.11.2014

a czemu nie tak ?

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Scoreboard"
#define VERSION "1.0"
#define AUTHOR "Tester"

new TerrorWins
new CounterWins

new Terrorists
new CounterTerrorists

new SyncHudObj;

new Float:g_round_start = -1.0;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	set_task(1.0,"HUD", 0,"",0,"b")
	
	SyncHudObj = CreateHudSyncObj();
	
	register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin") 
	register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
	
	register_logevent("EventRoundStart", 2, "1=Round_Start");
	register_logevent("EventRoundEnd", 2, "1=Round_End");
	register_event("TextMsg", "EventRoundRestart", "a", "2&#Game_C", "2&#Game_w");
	
}

public HUD()
{ 
	new iPlayers[32]
	get_players(iPlayers, Terrorists, "ae", "TERRORIST");
	get_players(iPlayers, CounterTerrorists, "ae", "CT");  
	
	set_hudmessage(0, 255, 0, 0.2, 0.0, 0, 6.0, 1.0,0.0,0.1,false)
	ShowSyncHudMsg(0, SyncHudObj, "Terro [%i] | [%i]^nCTerro [%i] | [%i]", TerrorWins,Terrorists, CounterWins, CounterTerrorists);
}
public t_win()
{
	TerrorWins++
}

public ct_win()
{
	CounterWins++
}
public EventRoundEnd()
{
	g_round_start = -1.0;
}

public EventRoundRestart()
{
	g_round_start = -1.0;
}

Odpowiedz

  • +
  • -
Rellik # - zdjęcie Rellik # 12.11.2014

Chciałbym hud 2 kolorowe. 

Odpowiedz

  • +
  • -
Dziobak? - zdjęcie Dziobak? 14.11.2014

Może tak:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Scoreboard"
#define VERSION "1.0"
#define AUTHOR "Tester"

new TerrorWins
new CounterWins

new Terrorists
new CounterTerrorists

new SyncHudObj;

new Float:g_round_start = -1.0;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	set_task(1.0,"HUD", 0,"",0,"b")
	
	SyncHudObj = CreateHudSyncObj();
	
	register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin") 
	register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
	
	register_logevent("EventRoundStart", 2, "1=Round_Start");
	register_logevent("EventRoundEnd", 2, "1=Round_End");
	register_event("TextMsg", "EventRoundRestart", "a", "2&#Game_C", "2&#Game_w");
	
}

public HUD()
{ 
	new iPlayers[32]
	get_players(iPlayers, Terrorists, "ae", "TERRORIST");
	get_players(iPlayers, CounterTerrorists, "ae", "CT");  
	
	set_hudmessage(0, 255, 0, 0.2, 0.0, 0, 6.0, 1.0,0.0,0.1,false)
	ShowSyncHudMsg(0, SyncHudObj, "CTerro [%i] | [%i]", CounterWins, CounterTerrorists);
	
	set_hudmessage(255, 255, 255, 0.6, 0.0, 0, 6.0, 1.0,0.0,0.1,false)
	ShowSyncHudMsg(0, SyncHudObj, "Terro [%i] | [%i]", TerrorWins,Terrorists);
}
public t_win()
{
	TerrorWins++
}

public ct_win()
{
	CounterWins++
}
public EventRoundEnd()
{
	g_round_start = -1.0;
}

public EventRoundRestart()
{
	g_round_start = -1.0;
}
Odpowiedz