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

Połączenie ze sobą dwóch pluginów z klasą


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

#1 sebul

    Godlike

  • Przyjaciel

Reputacja: 2 035
Godlike

  • Postów:5 411
  • Steam:steam
  • Imię:Sebastian
  • Lokalizacja:Ostrołęka
Offline

Napisano 08.08.2010 21:01

Witam. Chodzi mi o połączenie tych dwóch pluginów
/*================================================================================

-----------------------------------
-*- [ZP] Default Zombie Classes -*-
-----------------------------------

~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~

This plugin adds the default zombie classes to Zombie Plague.
Feel free to modify their attributes to your liking.

Note: If zombie classes are disabled, the first registered class
will be used for all players (by default, Classic Zombie).

CVARS:
zp_tight_jump 2 (Default)

================================================================================*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <zombieplague>

/*================================================================================
[Plugin Customization]
=================================================================================*/

// Classic Zombie Attributes
new const zclass1_name[] = { "Classic Zombie" } // nazwa
new const zclass1_info[] = { "=Balanced=" } // opis
new const zclass1_model[] = { "zombie_source" } // model
new const zclass1_clawmodel[] = { "v_swipe.mdl" } // model noza
const zclass1_health = 2700 // zdrowie
const zclass1_speed = 220 // szybkosc
const Float:zclass1_gravity = 1.0 // grawitacja
const Float:zclass1_knockback = 1.0 // odrzut

// Raptor Zombie Attributes
new const zclass2_name[] = { "Raptor Zombie" }
new const zclass2_info[] = { "HP-- Speed+++ Knockback++" }
new const zclass2_model[] = { "zombie_fast" }
new const zclass2_clawmodel[] = { "v_HunterZ.mdl" }
const zclass2_health = 2100
const zclass2_speed = 270
const Float:zclass2_gravity = 1.0
const Float:zclass2_knockback = 1.50

// Tight Zombie Attributes
new const zclass3_name[] = { "Tight Zombie" }
new const zclass3_info[] = { "HP- Jump++ Knockback++" }
new const zclass3_model[] = { "zombie_terror" }
new const zclass3_clawmodel[] = { "v_hands_terror.mdl" }
const zclass3_health = 2400
const zclass3_speed = 220
const Float:zclass3_gravity = 0.80
const Float:zclass3_knockback = 1.40

// Big Zombie Attributes
new const zclass4_name[] = { "Big Zombie" }
new const zclass4_info[] = { "HP++ Speed-- Knockback--" }
new const zclass4_model[] = { "zombie_fat" }
new const zclass4_clawmodel[] = { "v_knife_fat.mdl" }
const zclass4_health = 3300
const zclass4_speed = 190
const Float:zclass4_gravity = 1.0
const Float:zclass4_knockback = 0.5

// Leech Zombie Attributes
new const zclass5_name[] = { "Leech Zombie" }
new const zclass5_info[] = { "HP- Knockback- Leech++" }
new const zclass5_model[] = { "zombie_headcrab2" }
new const zclass5_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass5_health = 2400
const zclass5_speed = 220
const Float:zclass5_gravity = 1.00
const Float:zclass5_knockback = 0.75
const zclass5_infecthp = 300 // extra hp for infections

/*============================================================================*/

// Class IDs
new g_zclass_leech
new jumpznum[33] = 0
new bool:dozjump[33] = false
new cvar_jumps
new g_zclass_tight

// Tight
public plugin_init() {
register_plugin("[ZP] Class Tight and other Class", "1.0c", "MultiJump by twistedeuphoria, Plagued by Dabbi, Classed by B!gBud")
cvar_jumps = register_cvar("zp_tight_jump","2")
}

public client_putinserver(id) {
jumpznum[id] = 0
dozjump[id] = false
}

public client_disconnect(id) {
jumpznum[id] = 0
dozjump[id] = false
}

public client_PreThink(id) {
if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
if(zp_get_user_zombie_class(id) != g_zclass_tight) return PLUGIN_CONTINUE

new nzbut = get_user_button(id)
new ozbut = get_user_oldbutton(id)
if((nzbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(ozbut & IN_JUMP)) {
if (jumpznum[id] < get_pcvar_num(cvar_jumps)) {
dozjump[id] = true
jumpznum[id]++
return PLUGIN_CONTINUE
}
}
if((nzbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND)) {
jumpznum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public client_PostThink(id) {
if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
if(zp_get_user_zombie_class(id) != g_zclass_tight) return PLUGIN_CONTINUE

if(dozjump[id] == true) {
new Float:vezlocityz[3]
entity_get_vector(id,EV_VEC_velocity,vezlocityz)
vezlocityz[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,vezlocityz)
dozjump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache() {
// Register all classes
zp_register_zombie_class(zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, zclass1_knockback)
zp_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, zclass2_knockback)
g_zclass_tight = zp_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, zclass3_knockback)
zp_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, zclass4_knockback)
g_zclass_leech = zp_register_zombie_class(zclass5_name, zclass5_info, zclass5_model, zclass5_clawmodel, zclass5_health, zclass5_speed, zclass5_gravity, zclass5_knockback)
}

// User Infected forward
public zp_user_infected_post(id, infector) {
// If attacker is a leech zombie, gets extra hp
if (zp_get_user_zombie_class(infector) == g_zclass_leech)
set_pev(infector, pev_health, float(pev(infector, pev_health) + zclass5_infecthp))
}

i
/*
[ZP] Class : Zombie Regeneration
( Passive zombie skill )
by Fry


Description :

This is another zombie class only this zombie are allowed to heal him self after certain time of amount he will be healing.
All you can change by cvars.


Cvars :

zp_regen_time "3.0" - After how much seconds will be healing, default is after 3 seconds.
zp_regen_amount "15.0" - How much HP you will gain in healing process, default is 15 hp in 3 seconds.


Credits :

hleV - For his created plugin.


Changelog :

06/11/2008 - v1.0 - First release
16/06/2009 - v1.0.4 - removed toggle cvar, fixed health was regenerate more than max (all the time), prevented this class for Nemesis, optimized code.
27/06/2009 - v1.0.5 - fixed minor bug.
*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Class : Zombie Regeneration"
#define VERSION "1.0.5"
#define AUTHOR "Fry!"

new const zclass_name[] = "Zombie Regeneration"
new const zclass_info[] = "HP-- Speed++++ Knockback+"
new const zclass_model[] = "zombie_source"
new const zclass_clawmodel[] = "v_knife_zombie.mdl"
const zclass_health = 2400
const zclass_speed = 300
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.25

new g_zclass_regen, g_regen_time, g_regen_amount

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_cvar("zp_zclass_zombie_regeneration",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)

g_regen_time = register_cvar("zp_regen_time", "3.0")
g_regen_amount = register_cvar("zp_regen_amount", "15.0")

register_event("Damage", "SetRegeneration", "be", "2>0")
}

public plugin_precache()
{
g_zclass_regen = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass_regen)
{
Regenerate(player)
}
}

public SetRegeneration(player)
{
if (!is_user_alive(player) || !zp_get_user_zombie(player) || zp_get_user_nemesis(player))
return PLUGIN_CONTINUE

if (zp_get_user_zombie_class(player) != g_zclass_regen)
return PLUGIN_CONTINUE

if (get_user_health(player) < zp_get_zombie_maxhealth(player))
set_task(get_pcvar_float(g_regen_time), "Regenerate", player, _, _, "b")

return PLUGIN_CONTINUE
}

public Regenerate(player)
{
if (!is_user_alive(player) || !zp_get_user_zombie(player) || zp_get_user_nemesis(player))
return PLUGIN_CONTINUE

if (zp_get_user_zombie_class(player) != g_zclass_regen)
return PLUGIN_CONTINUE

new regen_health = get_user_health(player)
new max_health = zp_get_zombie_maxhealth(player) - regen_health

if (max_health <= get_pcvar_num(g_regen_amount))
{
set_pev(player, pev_health, regen_health + float(max_health))
}

if (max_health <= get_pcvar_num(g_regen_amount) <= zclass_health)
{
remove_task(player)
}

set_pev(player, pev_health, regen_health + get_pcvar_float(g_regen_amount))

return PLUGIN_CONTINUE
}

Tylko te połączenie ma być na takiej zasadzie, aby każda klasa miała tą funkcję autoregeneracji. Sam próbowałem, ale przy kompilacji pluginu wyskakiwały errory, albo dotyczące "public zp_user_infected_post(player, infector)" albo "max_health". Z góry dzięki za pomoc ;] Dodatkowo załączam pliki .sma do załączników.

Załączone pliki

  • Załączony plik  sma.rar   2,25 KB  31 Ilość pobrań

  • +
  • -
  • 0

Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo


#2 hardbot

    Banned

  • Zbanowany

Reputacja: 0
Nowy

  • Postów:3 049
Offline

Napisano 08.08.2010 21:16

zobacz to :D

Załączone pliki



#3 sebul

    Godlike

  • Autor tematu
  • Przyjaciel

Reputacja: 2 035
Godlike

  • Postów:5 411
  • Steam:steam
  • Imię:Sebastian
  • Lokalizacja:Ostrołęka
Offline

Napisano 08.08.2010 22:00

Dzięki za pomoc, ale chodziło mi o takie połączenie, żeby każda klasa miała tą autoregenerację (nie wiem czy tak się da, ale może...), tylko teraz i tak już nie ma co, ta autoregeneracja ma bug, czyli za szybko hp wzrasta, że nawet zombiaka zabić się nie da, pomimo, że cvary ustawione są jak trzeba. Działa dobrze tylko wtedy, jeśli zombi spadnie z jakiejś wysokości to wtedy idzie po te 15 hp na 3 sekundy (takie domyślne cvary są). No cóż... nie będzie autoregeneracji ;/
  • +
  • -
  • 0

Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo





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

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