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
Naprawienie

Naprawa bugow

Naprawienie

  • Zamknięty Temat jest zamknięty
1 odpowiedź w tym temacie

#1 Gufinsky

    Wszechwiedzący

  • Power User

Reputacja: 267
Wszechwidzący

  • Postów:591
  • Imię:Kuba
  • Lokalizacja:localhost
Offline

Napisano 08.04.2011 22:10

Kod:

Spoiler


Errory:

L 04/08/2011 - 00:12:46: [AMXX] Displaying debug trace (plugin "dd2.amxx")
L 04/08/2011 - 00:12:46: [AMXX] Run time error 4: index out of bounds 
L 04/08/2011 - 00:12:46: [AMXX]    [0] colorchat.inc::ColorChat (line 53)
L 04/08/2011 - 00:12:46: [AMXX]    [1] dd2.sma::event_RoundStart (line 51)

  • +
  • -
  • 0

#2 speedkill

    Godlike

  • Przyjaciel

Reputacja: 1 592
Godlike

  • Postów:2 733
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Prudnik
Offline

Napisano 11.04.2011 14:16

może to :
/* 
  Changelog:
   1.0 - pierwsze wydanie pluginu.
   1.1 - poprawione zaliczanie punktu za wybuch C4
   1.2 - dodana opcja zamiany druzyn
   1.3 - naprawiono errory z colorchatem - by DarkGL
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
new tt, ct, plimit, pchange;
new SayTxT
public plugin_init() {
	register_plugin("DD2", "1.3", "byQQ");
	RegisterHam(Ham_Spawn, "player", "event_RoundStart", 1) 
	
	register_message(get_user_msgid("TextMsg"), "message_TextMsg");
	SayTxT = get_user_msgid("SayText");
	plimit = register_cvar("rr_limit", "20");
	pchange = register_cvar("rr_change", "1");
}

public message_TextMsg( const MsgId, const MsgDest, const MsgEntity )
{       
	static message[32]; get_msg_arg_string(2, message, charsmax(message));
	
	if(equal(message, "#Game_will_restart_in")) { ct = tt = 0; }
	else if(equal(message, "#Terrorists_Win") || equal(message, "#Target_Bombed")) { tt++; }
	else if(equal(message, "#CTs_Win")) { ct++; }       
}

public event_RoundStart()
{
	new limit = get_pcvar_num(plimit);
	new sumka = ct+tt;
	
	if(sumka >= limit) 
	{
		if(get_pcvar_num(pchange)) ZamianaTeam();
		
		set_cvar_num("sv_restart", 3);
		set_cvar_num("amx_reloadadmins", 1);
		if(tt > ct) client_printcolor(0, "/g [DUST 2] Wygrali Terrorysci %d/%d", tt, ct);
		else client_printcolor(0, "/g [DUST 2] Wygrali Anty Terrorysci %d/%d", ct, tt);
				
		ct = tt = 0;
	}       
	else client_printcolor(0, "/g [DUST 2]^x04 Restart mapy za %d rund", limit - (ct+tt));
}

public ZamianaTeam()
{
	new players[32], num;
	get_players(players, num);
	
	for(new i = 0; i < num; i++)
	{		
		cs_set_user_team(players[i], cs_get_user_team(players[i]) == CS_TEAM_CT ? CS_TEAM_T : CS_TEAM_CT);
	}
	client_printcolor(0, "/g [DUST 2] Zamieniam druzyny!");
}
stock client_printcolor(const id, const input[], any:...)
{
	new count = 1, players[32];
	static msg[191];
	vformat(msg,190,input,3);
	replace_all(msg,190,"/g","^4");// green txt
	replace_all(msg,190,"/y","^1");// orange txt
	replace_all(msg,190,"/ctr","^3");// team txt
	replace_all(msg,190,"/w","^0");// team txt
	if (id) players[0] = id; else get_players(players,count,"ch");
	for (new i = 0; i < count; i++)
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, SayTxT, _, players[i]);
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
}
lub to :) :
/* 
  Changelog:
   1.0 - pierwsze wydanie pluginu.
   1.1 - poprawione zaliczanie punktu za wybuch C4
   1.2 - dodana opcja zamiany druzyn
   1.3 - naprawiono errory z colorchatem - by DarkGL
*/

#include <amxmodx>
#include <cstrike>

new tt, ct, plimit, pchange;
new SayTxT
public plugin_init() {
	register_plugin("DD2", "1.3", "byQQ"); 
	register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0") 
	
	register_message(get_user_msgid("TextMsg"), "message_TextMsg");
	SayTxT = get_user_msgid("SayText");
	plimit = register_cvar("rr_limit", "20");
	pchange = register_cvar("rr_change", "1");
}

public message_TextMsg( const MsgId, const MsgDest, const MsgEntity )
{       
	static message[32]; get_msg_arg_string(2, message, charsmax(message));
	
	if(equal(message, "#Game_will_restart_in")) { ct = tt = 0; }
	else if(equal(message, "#Terrorists_Win") || equal(message, "#Target_Bombed")) { tt++; }
	else if(equal(message, "#CTs_Win")) { ct++; }       
}

public event_RoundStart()
{
	new limit = get_pcvar_num(plimit);
	new sumka = ct+tt;
	
	if(sumka >= limit) 
	{
		if(get_pcvar_num(pchange)) ZamianaTeam();
		
		set_cvar_num("sv_restart", 3);
		set_cvar_num("amx_reloadadmins", 1);
		if(tt > ct) client_printcolor(0, "/g [DUST 2] Wygrali Terrorysci %d/%d", tt, ct);
		else client_printcolor(0, "/g [DUST 2] Wygrali Anty Terrorysci %d/%d", ct, tt);
				
		ct = tt = 0;
	}       
	else client_printcolor(0, "/g [DUST 2]^x04 Restart mapy za %d rund", limit - (ct+tt));
}

public ZamianaTeam()
{
	new players[32], num;
	get_players(players, num);
	
	for(new i = 0; i < num; i++)
	{		
		cs_set_user_team(players[i], cs_get_user_team(players[i]) == CS_TEAM_CT ? CS_TEAM_T : CS_TEAM_CT);
	}
	client_printcolor(0, "/g [DUST 2] Zamieniam druzyny!");
}
stock client_printcolor(const id, const input[], any:...)
{
	new count = 1, players[32];
	static msg[191];
	vformat(msg,190,input,3);
	replace_all(msg,190,"/g","^4");// green txt
	replace_all(msg,190,"/y","^1");// orange txt
	replace_all(msg,190,"/ctr","^3");// team txt
	replace_all(msg,190,"/w","^0");// team txt
	if (id) players[0] = id; else get_players(players,count,"ch");
	for (new i = 0; i < count; i++)
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, SayTxT, _, players[i]);
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
}

  • +
  • -
  • 0

If you can dream it, you can do it.






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

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

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