Więc tak, wkurzyłem się trochę i postanowiłem sam sklecić surf moda, pozbierałem kody z pluginów i połączyłem w całość, wszystkie funkcje działają ok, oprócz respawn(link do oryginału powyżej)
Początkowo nie dawałem respawnu, bo tak jak podejrzewałem to właśnie ta część crashuje serwer, po dodaniu zdarzają się crashe
Jest tego jakieś 200 linii(plus te newy, registery itd, nie załączam ich bo długo by szukać tego znowu)
Oczywiście spełnia swoją funkcję- automatyczny respawn+ say /respawn jednak crashuje serwer.
////////////////////////////////////////// // RZECZY ZWIĄZANE Z RESPAWNEM // ////////////////////////////////////////// //dodane 27.05 w szkole public hook_DeathMsg() { //log_amx("AT: hook_DeathMsg"); new victim; victim = read_data(2); // Clipon/off //if(g_isClipping[victim]) { remove_task(victim + 2986); // g_isClipping[victim] = false; } // Auto respawn if(get_pcvar_num(sv_autoresp) && get_pdata_int(victim, 114, 5) != 3) set_task(1.8, "task_caughtDeathSpawn", victim + 483); return FMRES_HANDLED; } public hook_UpdateClientData(id, sendweapons, cd_handle) { //log_amx("AT: hook_UpdateClientData"); // oryginał if(!is_user_alive(id) || !g_isClipping[id]) if(!is_user_alive(id)) return FMRES_IGNORED; set_cd(cd_handle, CD_ID, 0); return FMRES_HANDLED; } //koniec public respawnPlayer(id) { //log_amx("AT: respawnPlayer"); new Float:gametime = get_gametime(); if(nextSpawnTime[id] < gametime) { //cancelTimer(id); dllfunc(DLLFunc_Spawn, id); nextSpawnTime[id] = gametime + 3.0; return FMRES_IGNORED; } client_print(id, print_chat, "You must wait %i more seconds to respawn.", floatround(nextSpawnTime[id] - gametime, floatround_ceil)); return FMRES_IGNORED; } public task_caughtDeathSpawn(id) { //log_amx("AT: task_caughtDeathSpawn"); id -= 483; if(is_user_connected(id)) dllfunc(DLLFunc_Spawn, id); } public hook_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { //log_amx("AT: hook_TakeDamage"); new toggledamage; toggledamage = get_pcvar_num(sv_toggledamage); if(toggledamage == 1) { // Remove only fall damage if(idattacker == 0) return HAM_SUPERCEDE; else if(checkAutoRespawn(this, damage)) return HAM_SUPERCEDE; } else if(toggledamage == 2) { // Remove only player damage if(is_user_connected(idattacker)) return HAM_SUPERCEDE; else if(checkAutoRespawn(this, damage)) return HAM_SUPERCEDE; } else if(toggledamage == 3) { // Remove both fall and player damage if(idattacker == 0 || is_user_connected(idattacker)) return HAM_SUPERCEDE; else if(checkAutoRespawn(this, damage)) return HAM_SUPERCEDE; } else if(checkAutoRespawn(this, damage)) return HAM_SUPERCEDE; return PLUGIN_CONTINUE; } stock checkAutoRespawn(this, Float:damage) { //log_amx("AT: checkAutoRespawn"); if(get_pcvar_num(sv_autoresp)) { health[this] -= damage; if(health[this] < 1.0) { set_pev(this, pev_health, 0.0); set_pev(this, pev_deadflag, DEAD_RESPAWNABLE); dllfunc(DLLFunc_Spawn, this); //cancelTimer(this); return 1; } } return 0; } public hook_KeyValue(entId, kvd_id) { //log_amx("AT: hook_KeyValue"); if(!pev_valid(entId)) return FMRES_HANDLED; new className[64]; pev(entId, pev_classname, className, 63); //if(get_pcvar_num(sv_removet)) { if(containi(className, "info_player_deathmatch") != -1) engfunc(EngFunc_RemoveEntity, entId); } //if(!get_pcvar_num(sv_togglebuy)) { if(containi(className, "func_buyzone") != -1) engfunc(EngFunc_RemoveEntity, entId); } if(containi(className, "func_bomb_target") != -1) engfunc(EngFunc_RemoveEntity, entId); return FMRES_HANDLED; } public task_checkConnectDead(id) { //log_amx("AT: task_checkConnectDead"); id -= 654; if(is_user_connected(id)) { new team = get_pdata_int(id, 114, 5); if(!is_user_alive(id) && firstSpawn[id] && (team == 1 || team == 2)) { // Spawn them set_task(1.8, "task_caughtDeathSpawn", id + 483); } else if(!is_user_alive(id) && firstSpawn[id] && (team != 1 && team != 2)) { // Check again set_task(1.8, "task_checkConnectDead", id + 654); } } else if(is_user_connecting(id)) set_task(1.8, "task_checkConnectDead", id + 654); return FMRES_HANDLED; }
Pozdrawiam