Plugin crashuje serwer
naven
28.10.2009
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:
Plugin:
error logów brak...
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...
mgr inż. Pavulon
28.10.2009
tylko że na 100% to nie jest on gdyż on nie wysyła żadnej wiadomości MSG_ONE/MSG_ONE_UNRELIABLE ani żadnej innej.
Vertricus
28.10.2009
@up
Colorchat.inc -> więc chyba wysyła przynajmniej tak mi się zdaje ;d
[ 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.
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.
naven
28.10.2009
Pavulon, za każdym razem jak go włączę są crashe
Verticus, przeliczyłem, ta najdłuższa ma jakieś 130
Verticus, przeliczyłem, ta najdłuższa ma jakieś 130
mgr inż. Pavulon
28.10.2009
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:
zamiast:
daj:public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
static message[256];
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) { if(!is_user_connected(id) return static message[256];