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

Plugin crashuje serwer


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

#1 naven

    Hero

  • Power User

Reputacja: 204
Profesjonalista

  • Postów:1 088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 28.10.2009 18:47

Witam, komunikat w konsoli serwera jest całkowicie inny niżbym się go spodziewał, na pewno powoduje go ten plugin, wyłączyłem wszystkie inne i ciągle były crashe, włączyłem wszystko, a został ten, to ciągle były.

Błąd:
FATAL ERROR (shutting down): MSG_ONE or MSG_ONE_UNRELIABLE with no target entity

Plugin:
#include <amxmodx>
#include <engine>
#include <colorchat>

#define	FL_WATERJUMP	(1<<11)	// player jumping out of water
#define	FL_ONGROUND	(1<<9)	// At rest / on the ground

new bhoff [33]

public plugin_init() {
	register_plugin("Bhop on/off", "1.2", "Cheasy & naven")
	register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
	register_clcmd("say bhoff", "funcoff")
	register_clcmd("bhoff", "funcoff")
	register_clcmd("say bhon", "funcon")
	register_clcmd("bhon", "funcon")
	set_task(60.0, "reklama",_,_, _, "b")
	
	register_cvar("bh_enabled", "1")
	register_cvar("bh_autojump", "1")
	register_cvar("bh_showusage", "1")
}
public reklama(id){
	ColorChat(id, RED,"[BH]^x04 Jesli uwazasz ze jestes PRO na deathrun, ^x04wylacz sobie bh(say bhoff,^x03 aby znow wlaczyc say bhon)")
}
public funcoff(id){
	bhoff[id] = 1
	new name [32]
	get_user_name(id, name, 31)
	//client_print(0, print_chat, "test off %s", name)
	ColorChat(0, RED,"[BH]^x04 %s wylaczyl sobie^x03 bhopa komenda bhoff", name)
	return PLUGIN_HANDLED;
}
public funcon(id){
	bhoff[id] = 0
	new name [32];
	get_user_name(id, name, 31);
	//client_print(0, print_chat, "test on %s", name)
	ColorChat(0, RED,"[BH]^x04 %s wlaczyl sobie^x03 bhopa komenda bhon", name);
	return PLUGIN_HANDLED;
}
public client_PreThink(id) {
	if(bhoff[id] == 1){
	return PLUGIN_HANDLED;
}
	if (!get_cvar_num("bh_enabled"))
		return PLUGIN_CONTINUE

	entity_set_float(id, EV_FL_fuser2, 0.0)		// Disable slow down after jumping

	if (!get_cvar_num("bh_autojump"))
		return PLUGIN_CONTINUE

// Code from CBasePlayer::Jump (player.cpp)		Make a player jump automatically
	if (entity_get_int(id, EV_INT_button) & 2) {	// If holding jump
		new flags = entity_get_int(id, EV_INT_flags)

		if (flags & FL_WATERJUMP)
			return PLUGIN_CONTINUE
		if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
			return PLUGIN_CONTINUE
		if ( !(flags & FL_ONGROUND) )
			return PLUGIN_CONTINUE

		new Float:velocity[3]
		entity_get_vector(id, EV_VEC_velocity, velocity)
		velocity[2] += 250.0
		entity_set_vector(id, EV_VEC_velocity, velocity)

		entity_set_int(id, EV_INT_gaitsequence, 6)	// Play the Jump Animation
	}
	return PLUGIN_CONTINUE
}

public client_authorized(id)
	set_task(30.0, "showUsage", id)

public showUsage(id) {
	if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
		return PLUGIN_HANDLED

	ColorChat(id, GREEN, "[BH]^x04 Na serwerze wlaczony jest BH, nie bedziesz spowalnial skaczac")
	return PLUGIN_HANDLED
}


error logów brak...
  • +
  • -
  • 0

#2 mgr inż. Pavulon

    C35H60Br2N2O4

  • Przyjaciel

Reputacja: 1 742
Godlike

  • Postów:6 881
  • Steam:steam
  • Imię:Konrad
  • Lokalizacja:Koniecpol
Offline

Napisano 28.10.2009 19:05

tylko że na 100% to nie jest on gdyż on nie wysyła żadnej wiadomości MSG_ONE/MSG_ONE_UNRELIABLE ani żadnej innej.
  • +
  • -
  • 0

#3 Vertricus

    Godlike

  • Przyjaciel

Reputacja: 426
Wszechobecny

  • Postów:1 549
  • Lokalizacja:.
Offline

Napisano 28.10.2009 19:11

@up
Colorchat.inc -> więc chyba wysyła przynajmniej tak mi się zdaje ;d
//ColorChat(id, GREEN,"[Cosik]^x01 A nic");
#define MAXSLOTS 32

enum Color{
	YELLOW = 1, // Yellow
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}
new TeamName[][] = {
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	static message[256];

	switch(type)
	{
		case YELLOW:{ // Yellow
		
			message[0] = 0x01;
		}
		case GREEN:{// Green

			message[0] = 0x04;
		}
		default:{ // White, Red, Blue
			message[0] = 0x03;
		}
	}
	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';
	new team, ColorChange, index, MSG_Type;
	if(!id)	{
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	} else {
		MSG_Type = MSG_ONE;
		index = id;
	}
	team = get_user_team(index);	
	ColorChange = ColorSelection(index, MSG_Type, type);
	ShowColorMessage(index, MSG_Type, message);
	if(ColorChange){
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[]){
	message_begin(type, 76, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[]){
	message_begin(type, 86, _, id);
	write_byte(id);
	write_string(team);
	message_end();
	return 1;
}

ColorSelection(index, type, Color:Type){
	switch(Type)	{
		case RED:		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:		{
			return Team_Info(index, type, TeamName[0]);
		}
	}
	return 0;
}

FindPlayer(){
	new i = -1;
	while(i <= MAXSLOTS){
		if(is_user_connected(++i)){
			return i;
		}
	}

	return -1;
}


[ Dodano: 28-10-2009, 19:13 ]
// Make sure message is not longer than 192 character. Will crash the server.

Jeśli to powoduje crashe to skróć wiadomości jak będę miał czas to sprawdze.
  • +
  • -
  • 0

#4 naven

    Hero

  • Autor tematu
  • Power User

Reputacja: 204
Profesjonalista

  • Postów:1 088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 28.10.2009 19:13

Pavulon, za każdym razem jak go włączę są crashe
Verticus, przeliczyłem, ta najdłuższa ma jakieś 130
  • +
  • -
  • 0

#5 mgr inż. Pavulon

    C35H60Br2N2O4

  • Przyjaciel

Reputacja: 1 742
Godlike

  • Postów:6 881
  • Steam:steam
  • Imię:Konrad
  • Lokalizacja:Koniecpol
Offline

Napisano 28.10.2009 19:57

aaaa, sry. nie zauważyłem niczego w kodzie i nie przyszło mi do głowy że include może być zj....(popsuty).

zamiast:

public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
static message[256];

daj:
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
    if(!is_user_connected(id)
        return
    static message[256];

  • +
  • -
  • 0




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

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