Raised This Month: $ Target: $400
 0% 

Suggestion / Subplugin Request [REQ] Converting Zombie Class to zp 5.0.8


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ESPADONGAMING
Senior Member
Join Date: Mar 2011
Location: In the Game [ro]
Old 04-09-2012 , 04:06   [REQ] Converting Zombie Class to zp 5.0.8
Reply With Quote #1

Plz Fix error Line: 78 and 156

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <zp50_class_zombie>

// Predator Atributes
new const zclass_name[] = { "Predator 4" }
new const 
zclass_info[] = { "[Invincible]" }
new const 
zclass_models[][] = { "predator4" }
new const 
zclass_clawmodels[][] = { "models/zombie_plague/russki_predator_knife.mdl" }
const 
zclass_health 1600
const Float:zclass_speed 0.90
const Float:zclass_gravity 1.0
const Float:zclass_knockback 1.0

//Some vars
new g_ZombieClassID
new g_maxplayersg_status
new g_sndInv[] = "predator/predator.wav"
new cvar_ability_timecvar_invamountcvar_speedcvar_infect_hpcvar_cooldowncvar_gravitycvar_iconcvar_dmg_multi
new Float:g_last[33]
new 
keys MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
new g_icon[33][16]
new 
boolg_ability[33], boolg_bind[33] = falseboolg_use[33]

public 
plugin_init()
{    
        
cvar_dmg_multi register_cvar("zp_predator_dmg_multi""3")
        
cvar_ability_time register_cvar("zp_Predator_ability_long""10")
        
cvar_invamount register_cvar("zp_Predator_visible_amount""0")
        
cvar_speed register_cvar("zp_Predator_max_speed""400")
        
cvar_infect_hp register_cvar("zp_Predator_infect_hp""300")
        
cvar_cooldown register_cvar("zp_Predator_cooldown""30")
        
cvar_gravity register_cvar("zp_Predator_gravity""700")
        
cvar_icon register_cvar("zp_Predator_icon""1")
    
        
register_clcmd("ability","ability"ADMIN_ALL"bind ^"key^" ^"ability^"")
        
register_forward(FM_PlayerPreThink"fw_ppt")
        
register_event("HLTV""newround""a""1=0""2=0")
        
register_event("DeathMsg""death""a")
        
register_menucmd(register_menuid("Do you want to bind P ability?"), keys"bind_p")
        
RegisterHamHam_TakeDamage"player""fw_TakeDamage" )
    
        
g_status get_user_msgid("StatusIcon")
}

public 
plugin_precache()
{
        
register_plugin("[ZP] Class: Predator""1.0.1""Teo & C(ESPADONGAMING)")
        
    new 
index
    
    g_ZombieClassID 
zp_class_zombie_register(zclass_namezclass_infozclass_healthzclass_speedzclass_gravity)
    
zp_class_zombie_register_kb(g_ZombieClassIDzclass_knockback)
    for (
index 0index sizeof zclass_modelsindex++)
        
zp_class_zombie_register_model(g_ZombieClassIDzclass_models[index])
    for (
index 0index sizeof zclass_clawmodelsindex++)
        
zp_class_zombie_register_claw(g_ZombieClassIDzclass_clawmodels[index])

        
precache_sound(g_sndInv)
}

public 
zp_user_infected_post(idinfector)
{
    if (
zp_class_zombie_get_current(infector) == g_ZombieClassID)
        {
        
set_pev(infectorpev_healthfloat(pev(infectorpev_health) + get_pcvar_num(cvar_infect_hp)))
        
set_hudmessage(25500, -1.00.4500.03.00.010.01, -1)
        
show_hudmessage(infector"+%i HP!"get_pcvar_num(cvar_infect_hp))
        }
    
        if (
zp_class_zombie_get_current(id) == g_ZombieClassID)
        {
        
g_ability[id] = false
        set_user_rendering
(idkRenderFxNone000kRenderNormal255)
        
set_user_maxspeed(idfloat(zclass_speed))
        
set_user_gravity(idzclass_gravity)
    }
        
    if (!
g_bind[id])
         {
        new 
menu[192]
        
format(menu191"Do you want to bind P ability?^n^n1. Yes^n2. No^n3. Ability on +USE")
        
show_menu(idkeysmenu)
         }
}

public 
zp_user_humanized_post(id)
        if(
zp_class_zombie_get_current(id) == g_ZombieClassID)
            
ability_end(id)

public 
bind_p(idkeys)
{
    
g_bind[id] = true
    
switch(keys)
    {
        case 
0:
            
client_cmd(id"bind p ability")
        
        case 
1:
            
client_print(idprint_chat"[ZP] To be invisible and increase your speed type in console: bind ^'^'key^'^' ^'^'ability^'^'. And than press it!")
        
        case 
2:
            
g_use[id] = true
        
        
default:
            
g_bind[id] = false
    
}
    
    return 
PLUGIN_HANDLED
}

public 
ability(id)
{
    if (
zp_core_is_zombie(id) && (zp_class_zombie_get_current(id) == g_ZombieClassID))
    {
        if(
g_ability[id])
        {
            
client_print(idprint_chat"[ZP] You are already invisible and have maximum speed.")
            return 
PLUGIN_HANDLED
        
}
        
        if(!
is_user_alive(id))
        {
            
client_print(idprint_chat"[ZP] You are dead now. Dead people can't use abilities.")
            return 
PLUGIN_HANDLED
        
}
        
        static 
Floati
        i 
get_pcvar_float(cvar_cooldown)
        
        if (
get_gametime() - g_last[id] < i) {
            
client_print(idprint_chat"[ZP] Wait %.f0 sec. to use your ability!"get_pcvar_float(cvar_cooldown) - (get_gametime() - g_last[id]))
            return 
PLUGIN_HANDLED
        
} else {
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlphaget_pcvar_num(cvar_invamount))
            
set_user_maxspeed(idget_pcvar_float(cvar_speed))
            
set_user_gravity(idget_pcvar_float(cvar_gravity) / 800)
            
emit_sound(idCHAN_BODYg_sndInv1.0ATTN_NORM0PITCH_HIGH)
            
set_hudmessage(2001000, -1.00.8500.03.00.010.01, -1)
            
show_hudmessage(id"You are now invisible. Time to hunt!")
            
set_task(get_pcvar_float(cvar_ability_time), "ability_end"id)
            if(
get_pcvar_num(cvar_icon) == 1)
            
set_icon(id)
            
g_ability[id] = true
        
}
    }
    return 
PLUGIN_CONTINUE
}

public 
ability_end(id)
{
    
set_user_rendering(idkRenderFxNone000kRenderNormal255)
    
set_user_maxspeed(idfloat(zclass_speed))
    
set_user_gravity(idzclass_gravity)
    
    if (
get_pcvar_num(cvar_cooldown) > 0)
        
client_print(idprint_chat"[ZP] Wait %i sec to use your ability again."get_pcvar_num(cvar_cooldown))
    
    if(
get_pcvar_num(cvar_icon) == 1)
        
delete_icon(id)
    
    
g_last[id] = get_gametime()
    
g_ability[id] = false
}

public 
fw_ppt(id)
{
    if (!
is_user_alive(id) || !zp_core_is_zombie(id))
        return 
FMRES_IGNORED
    
    
if (g_use[id])
    {
        static 
buttonoldbutton
        button 
get_user_button(id)
        
oldbutton get_user_oldbutton(id)
        
        if (!(
button IN_USE) && (oldbutton IN_USE))      
            
ability(id)
    }
    
    if (
g_ability[id] && (zp_class_zombie_get_current(id) == g_ZombieClassID) && zp_core_is_zombie(id))
    {
        
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlphaget_pcvar_num(cvar_invamount))
        
set_user_maxspeed(idget_pcvar_float(cvar_speed))
        
set_pev(idpev_flTimeStepSound999)
        
set_user_gravity(idget_pcvar_float(cvar_gravity) / 800)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
newround()
{
    
g_maxplayers get_maxplayers()
    
    for (new 
id 1id <= g_maxplayersid++)
    {
        
g_last[id] = get_gametime()
        
g_ability[id] = false
    
}
}

public 
fw_TakeDamagevictiminflictorattackerFloat:damagedamagebits )
{
        if ((
zp_class_zombie_get_current(attacker) == g_ZombieClassID) && (get_user_weapon(attacker) == CSW_KNIFE))
        {
                
SetHamParamFloat4damage get_pcvar_float(cvar_dmg_multi) )
        }
}

public 
death()
{
    new 
id read_data(2)
    
ability_end(id)
    return 
PLUGIN_HANDLED
}

public 
set_icon(id)
{
    static 
color[3], sprite[16]
    
color = {250250250}
    
sprite "dmg_gas"
    
g_icon[id] = sprite
    
    message_begin
(MSG_ONEg_status, {000}, id)
    
write_byte(1)
    
write_string(g_icon[id])
    
write_byte(color[0])
    
write_byte(color[1])
    
write_byte(color[2])
    
message_end()
}

public 
delete_icon(id
{
    
message_begin(MSG_ONEg_status, {000}, id)
    
write_byte(0)
    
write_string(g_icon[id])
    
message_end()
}

stock get_user_button(id)
    return 
pev(idpev_button)

stock get_user_oldbutton(id)
    return 
pev(idpev_oldbuttons
__________________
Skype: cristi.c94
SteamID: cristic_1994

Last edited by ESPADONGAMING; 04-09-2012 at 04:07.
ESPADONGAMING is offline
Send a message via MSN to ESPADONGAMING Send a message via Yahoo to ESPADONGAMING Send a message via Skype™ to ESPADONGAMING
Heyka
Member
Join Date: Mar 2012
Old 04-09-2012 , 17:04   Re: [REQ] Converting Zombie Class to zp 5.0.8
Reply With Quote #2

Done.
Spoiler
Heyka is offline
ESPADONGAMING
Senior Member
Join Date: Mar 2011
Location: In the Game [ro]
Old 04-10-2012 , 06:31   Re: [REQ] Converting Zombie Class to zp 5.0.8
Reply With Quote #3

Thx
__________________
Skype: cristi.c94
SteamID: cristic_1994
ESPADONGAMING is offline
Send a message via MSN to ESPADONGAMING Send a message via Yahoo to ESPADONGAMING Send a message via Skype™ to ESPADONGAMING
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode