Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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
Zombie Plague 4.3

Przerobienie pod wersję 4.3

zombie plague 4.3

  • Zamknięty Temat jest zamknięty
Brak odpowiedzi do tego tematu

#1 ZyciE

    Banned

  • Zbanowany

Reputacja: 30
Życzliwy

  • Postów:225
  • GG:
  • Imię:Mateusz
  • Lokalizacja:Wiąg
Offline

Napisano 07.08.2013 17:11

Witam mam Pewień plugin na zp 5.0 A chciałbym aby mi ktoś go przerobił  na Zp 4.3 

daje kod :

/*================================================================================
 
------------------------
-*- [ZP] Nightvision -*-
------------------------
 
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
 
================================================================================*/
 
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <cs_ham_bots_api>
#include <zp50_core>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
 
#define TASK_NIGHTVISION 100
#define ID_NIGHTVISION (taskid - TASK_NIGHTVISION)
 
#define flag_get(%1,%2) (%1 & (1 << (%2 & 31)))
#define flag_get_boolean(%1,%2) (flag_get(%1,%2) ? true : false)
#define flag_set(%1,%2) %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2) %1 &= ~(1 << (%2 & 31))
 
new g_NightVisionActive
 
new g_MsgNVGToggle
 
new cvar_nvision_custom
new cvar_nvision_zombie, cvar_nvision_zombie_color_R, cvar_nvision_zombie_color_G, cvar_nvision_zombie_color_B, cvar_nvision_zombie_alpha
new cvar_nvision_human, cvar_nvision_human_color_R, cvar_nvision_human_color_G, cvar_nvision_human_color_B, cvar_nvision_human_alpha
new cvar_nvision_spec, cvar_nvision_spec_color_R, cvar_nvision_spec_color_G, cvar_nvision_spec_color_B, cvar_nvision_spec_alpha
new cvar_nvision_nemesis, cvar_nvision_nemesis_color_R, cvar_nvision_nemesis_color_G, cvar_nvision_nemesis_color_B, cvar_nvision_nemesis_alpha
new cvar_nvision_survivor, cvar_nvision_survivor_color_R, cvar_nvision_survivor_color_G, cvar_nvision_survivor_color_B, cvar_nvision_survivor_alpha
 
public plugin_init()
{
register_plugin("[ZP] Nightvision", ZP_VERSION_STRING, "ZP Dev Team")
 
g_MsgNVGToggle = get_user_msgid("NVGToggle")
register_message(g_MsgNVGToggle, "message_nvgtoggle")
 
register_clcmd("nightvision", "clcmd_nightvision_toggle")
register_event("ResetHUD", "event_reset_hud", "b")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
RegisterHamBots(Ham_Killed, "fw_PlayerKilled_Post", 1)
 
        cvar_nvision_custom = register_cvar("zp_nvision_custom", "0")
 
cvar_nvision_zombie = register_cvar("zp_nvision_zombie", "2") // 1-give only // 2-give and enable
cvar_nvision_zombie_color_R = register_cvar("zp_nvision_zombie_color_R", "0")
cvar_nvision_zombie_color_G = register_cvar("zp_nvision_zombie_color_G", "150")
cvar_nvision_zombie_color_B = register_cvar("zp_nvision_zombie_color_B", "0")
        cvar_nvision_zombie_alpha = register_cvar("zp_nvision_zombie_alpha", "70")
cvar_nvision_human = register_cvar("zp_nvision_human", "0") // 1-give only // 2-give and enable
cvar_nvision_human_color_R = register_cvar("zp_nvision_human_color_R", "0")
cvar_nvision_human_color_G = register_cvar("zp_nvision_human_color_G", "150")
cvar_nvision_human_color_B = register_cvar("zp_nvision_human_color_B", "0")
        cvar_nvision_human_alpha = register_cvar("zp_nvision_human_alpha", "70")
cvar_nvision_spec = register_cvar("zp_nvision_spec", "2") // 1-give only // 2-give and enable
cvar_nvision_spec_color_R = register_cvar("zp_nvision_spec_color_R", "0")
cvar_nvision_spec_color_G = register_cvar("zp_nvision_spec_color_G", "150")
cvar_nvision_spec_color_B = register_cvar("zp_nvision_spec_color_B", "0")
        cvar_nvision_spec_alpha = register_cvar("zp_nvision_spec_alpha", "70")
 
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library))
{
cvar_nvision_nemesis = register_cvar("zp_nvision_nemesis", "2")
cvar_nvision_nemesis_color_R = register_cvar("zp_nvision_nemesis_color_R", "150")
cvar_nvision_nemesis_color_G = register_cvar("zp_nvision_nemesis_color_G", "0")
cvar_nvision_nemesis_color_B = register_cvar("zp_nvision_nemesis_color_B", "0")
                cvar_nvision_nemesis_alpha = register_cvar("zp_nvision_nemesis_alpha", "70")
}
 
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library))
{
cvar_nvision_survivor = register_cvar("zp_nvision_survivor", "0")
cvar_nvision_survivor_color_R = register_cvar("zp_nvision_survivor_color_R", "0")
cvar_nvision_survivor_color_G = register_cvar("zp_nvision_survivor_color_G", "0")
cvar_nvision_survivor_color_B = register_cvar("zp_nvision_survivor_color_B", "150")
                cvar_nvision_survivor_alpha = register_cvar("zp_nvision_nemesis_alpha", "70")
}
}
 
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (equal(module, LIBRARY_NEMESIS) || equal(module, LIBRARY_SURVIVOR))
return PLUGIN_HANDLED;
 
return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED;
 
return PLUGIN_CONTINUE;
}
 
public zp_fw_core_infect_post(id, attacker)
{
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(id))
{
if (get_pcvar_num(cvar_nvision_nemesis))
{
if (!cs_get_user_nvg(id)) cs_set_user_nvg(id, 1)
 
if (get_pcvar_num(cvar_nvision_nemesis) == 2)
{
if (!flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else if (flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else
{
cs_set_user_nvg(id, 0)
 
if (flag_get(g_NightVisionActive, id))
DisableNightVision(id)
}
}
else
{
if (get_pcvar_num(cvar_nvision_zombie))
{
if (!cs_get_user_nvg(id)) cs_set_user_nvg(id, 1)
 
if (get_pcvar_num(cvar_nvision_zombie) == 2)
{
if (!flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else if (flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else
{
cs_set_user_nvg(id, 0)
 
if (flag_get(g_NightVisionActive, id))
DisableNightVision(id)
}
}
 
// Always give nightvision to PODBots
if (is_user_bot(id) && !cs_get_user_nvg(id))
cs_set_user_nvg(id, 1)
}
 
public zp_fw_core_cure_post(id, attacker)
{
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(id))
{
if (get_pcvar_num(cvar_nvision_survivor))
{
if (!cs_get_user_nvg(id)) cs_set_user_nvg(id, 1)
 
if (get_pcvar_num(cvar_nvision_survivor) == 2)
{
if (!flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else if (flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else
{
cs_set_user_nvg(id, 0)
 
if (flag_get(g_NightVisionActive, id))
DisableNightVision(id)
}
}
else
{
if (get_pcvar_num(cvar_nvision_human))
{
if (!cs_get_user_nvg(id)) cs_set_user_nvg(id, 1)
 
if (get_pcvar_num(cvar_nvision_human) == 2)
{
if (!flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else if (flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else
{
cs_set_user_nvg(id, 0)
 
if (flag_get(g_NightVisionActive, id))
DisableNightVision(id)
}
}
 
// Always give nightvision to PODBots
if (is_user_bot(id) && !cs_get_user_nvg(id))
cs_set_user_nvg(id, 1)
}
 
public clcmd_nightvision_toggle(id)
{
if (is_user_alive(id))
{
// Player owns nightvision?
if (!cs_get_user_nvg(id))
return PLUGIN_CONTINUE;
}
else
{
// Spectator nightvision disabled?
if (!get_pcvar_num(cvar_nvision_spec))
return PLUGIN_CONTINUE;
}
 
if (flag_get(g_NightVisionActive, id))
DisableNightVision(id)
else
EnableNightVision(id)
 
return PLUGIN_HANDLED;
}
 
// ResetHUD Removes CS Nightvision (bugfix)
public event_reset_hud(id)
{
if (!get_pcvar_num(cvar_nvision_custom) && flag_get(g_NightVisionActive, id))
cs_set_user_nvg_active(id, 1)
}
 
// Ham Player Killed Post Forward
public fw_PlayerKilled_Post(victim, attacker, shouldgib)
{
// Enable spectators nightvision?
spectator_nightvision(victim)
}
 
public client_putinserver(id)
{
// Enable spectators nightvision?
set_task(0.1, "spectator_nightvision", id)
}
 
public spectator_nightvision(id)
{
// Player disconnected
if (!is_user_connected(id))
return;
 
// Not a spectator
if (is_user_alive(id))
return;
 
if (get_pcvar_num(cvar_nvision_spec) == 2)
{
if (!flag_get(g_NightVisionActive, id))
clcmd_nightvision_toggle(id)
}
else if (flag_get(g_NightVisionActive, id))
DisableNightVision(id)
}
 
public client_disconnect(id)
{
// Reset nightvision flags
flag_unset(g_NightVisionActive, id)
remove_task(id+TASK_NIGHTVISION)
}
 
// Prevent spectators' nightvision from being turned off when switching targets, etc.
public message_nvgtoggle(msg_id, msg_dest, msg_entity)
{
return PLUGIN_HANDLED;
}
 
// Custom Night Vision Task
public custom_nightvision_task(taskid)
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, ID_NIGHTVISION)
write_short(0) // duration
write_short(0) // hold time
write_short(0x0004) // fade type
 
if (!is_user_alive(ID_NIGHTVISION))
{
write_byte(get_pcvar_num(cvar_nvision_spec_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_spec_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_spec_color_B)) // b
                write_byte(get_pcvar_num(cvar_nvision_spec_alpha))
}
// Zombie
else if (zp_core_is_zombie(ID_NIGHTVISION))
{
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(ID_NIGHTVISION))
{
write_byte(get_pcvar_num(cvar_nvision_nemesis_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_nemesis_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_nemesis_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_nemesis_alpha)) 
}
else
{
write_byte(get_pcvar_num(cvar_nvision_zombie_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_zombie_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_zombie_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_zombie_alpha)) 
}
}
// Human
else
{
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(ID_NIGHTVISION))
{
write_byte(get_pcvar_num(cvar_nvision_survivor_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_survivor_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_survivor_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_survivor_alpha)) 
}
else
{
write_byte(get_pcvar_num(cvar_nvision_human_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_human_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_human_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_human_alpha))
}
}
 
message_end()
 
set_player_light(ID_NIGHTVISION, "z")
}
 
public off(id)
{
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
 
        if (!is_user_alive(id))
{
write_byte(get_pcvar_num(cvar_nvision_spec_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_spec_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_spec_color_B)) // b
                write_byte(get_pcvar_num(cvar_nvision_spec_alpha))
}
// Zombie
else if (zp_core_is_zombie(id))
{
// Nemesis Class loaded?
if (LibraryExists(LIBRARY_NEMESIS, LibType_Library) && zp_class_nemesis_get(id))
{
write_byte(get_pcvar_num(cvar_nvision_nemesis_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_nemesis_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_nemesis_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_nemesis_alpha)) 
}
else
{
write_byte(get_pcvar_num(cvar_nvision_zombie_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_zombie_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_zombie_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_zombie_alpha)) 
}
}
// Human
else
{
// Survivor Class loaded?
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(id))
{
write_byte(get_pcvar_num(cvar_nvision_survivor_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_survivor_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_survivor_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_survivor_alpha)) 
}
else
{
write_byte(get_pcvar_num(cvar_nvision_human_color_R)) // r
write_byte(get_pcvar_num(cvar_nvision_human_color_G)) // g
write_byte(get_pcvar_num(cvar_nvision_human_color_B)) // b
                        write_byte(get_pcvar_num(cvar_nvision_human_alpha))
}
}
 
   message_end()
 
   set_player_light(id, "d")
}
 
EnableNightVision(id)
{
flag_set(g_NightVisionActive, id)
 
if (!get_pcvar_num(cvar_nvision_custom))
cs_set_user_nvg_active(id, 1)
else
set_task(0.1, "custom_nightvision_task", id+TASK_NIGHTVISION, _, _, "b")
}
 
DisableNightVision(id)
{
flag_unset(g_NightVisionActive, id)
 
if (!get_pcvar_num(cvar_nvision_custom))
cs_set_user_nvg_active(id, 0)
else
        {
remove_task(id+TASK_NIGHTVISION) 
                off(id)
        }
}
 
stock cs_set_user_nvg_active(id, active)
{
// Toggle NVG message
message_begin(MSG_ONE, g_MsgNVGToggle, _, id)
write_byte(active) // toggle
message_end()
}
 
stock set_player_light(id, const LightStyle[])
{
message_begin(MSG_ONE, SVC_LIGHTSTYLE, .player = id)
write_byte(0)
write_string(LightStyle)
message_end()
}

Załączone pliki


Play-Gaming.pl - Sieć  Serwerów  Gier.

Zapraszamy na nasze serwery : 

MineCraft - S1.E4G.MAXC.PL

Zombie Mod v3 [Otwarcie sobota] - 31.186.84.46:27050

Cod Mod  201 lvl -  193.33.177.117:27081






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

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

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