Raised This Month: $ Target: $400
 0% 

Suggestion / Subplugin Request Convert clases from 5.0 to 4.3 :P


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnowFake
Senior Member
Join Date: Oct 2012
Old 10-14-2015 , 08:09   Convert clases from 5.0 to 4.3 :P
Reply With Quote #1

Have someone time to do that ?
Attached Files
File Type: sma Get Plugin or Get Source (zp_zhuman_runner.sma - 453 views - 3.0 KB)
File Type: sma Get Plugin or Get Source (zp_zhuman_teleporter.sma - 482 views - 10.1 KB)
File Type: sma Get Plugin or Get Source (zp_zhuman_multijumper.sma - 488 views - 2.1 KB)
File Type: sma Get Plugin or Get Source (zp_zhuman_equipped.sma - 514 views - 3.3 KB)
File Type: sma Get Plugin or Get Source (invisible_human_v3.sma - 462 views - 2.3 KB)

Last edited by SnowFake; 10-14-2015 at 08:09.
SnowFake is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-14-2015 , 11:02   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #2

Is ZP4.3 support custom class for human?
zmd94 is offline
SnowFake
Senior Member
Join Date: Oct 2012
Old 10-14-2015 , 11:25   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #3

i have a zp 4.3 with support...

EDIT:
Quote:
#include <amxmodx>
#include <zp50_colorchat>
#include <zombieplague>

// Soldier Human Attributes
new const hclass_soldier_name[] = "Soldier Human"
new const hclass_soldier_info[] = "Armor or health for kill"
new const hclass_soldier_model[] = "zmland_player"
new const hclass_soldier_handmodel[] = "v_knife.mdl"
const hclass_soldier_health = 100
const hclass_soldier_speed = 240
const Float:hclass_soldier_gravity = 1.0

new g_hclass_soldier, g_soldier[33], g_infround, cvar_reward, cvar_convert[3],
g_total_earned[33][2], cvar_remove_reset_round, g_maxplayers, g_last_human, g_zombie[33]

enum
{
armor = 0,
health
}

new const g_sound_armor[] = "items/ammopickup2.wav"
new const g_sound_health[] = "items/smallmedkit1.wav"

public plugin_init()
{

register_plugin("[ZP] Soldier Human Class", "1.2", "Cristi. C")

register_dictionary("zp_hclass_soldier.txt")

cvar_reward = register_cvar("zp_soldier_reward", "35")
cvar_convert[0] = register_cvar("zp_soldier_convert_hum", "1")
cvar_convert[1] = register_cvar("zp_soldier_convert_surv", "0")
cvar_convert[2] = register_cvar("zp_soldier_convert_snip", "0")
cvar_remove_reset_round = register_cvar("zp_soldier_remove_reset_round" , "0")

g_maxplayers = get_maxplayers()
}

public plugin_precache()
{
g_hclass_soldier = zp_register_human_class(hclass_soldier_name, hclass_soldier_info, hclass_soldier_model, hclass_soldier_handmodel, hclass_soldier_health, hclass_soldier_speed, hclass_soldier_gravity)

precache_sound(g_sound_armor)
precache_sound(g_sound_health)
}

public plugin_cfg()
set_task(1.57, "cache_settings")

public cache_settings()
cvar_reward = get_pcvar_num(cvar_reward)

public client_disconnect(id)
{
g_soldier[id] = false
g_zombie[id] = false

zp_reset_rewards(id)
}

public zp_user_spawn_post(id)
{
g_zombie[id] = false

if (get_pcvar_num(cvar_convert[0]) && g_last_human)
{
static i

for (i = 0; i <= g_maxplayers; i++)
if (zp_get_user_valid(i) && g_soldier[i])
zp_convert_rewards(i, armor)

g_last_human = false
}

if (zp_get_user_human_class(id) != g_hclass_soldier)
{
g_soldier[id] = false

zp_reset_rewards(id)

return;
}

if (!get_pcvar_num(cvar_remove_reset_round))
{
if (get_pcvar_num(cvar_convert[0]))
zp_convert_rewards(id, armor)
}
else
{
// Didn't die(new round)
if (g_soldier[id])
{
if (g_total_earned[id][armor])
zp_set_user_armor(id, get_user_armor(id) - g_total_earned[id][armor])

zp_reset_rewards(id)
zp_colored_print(id, "%L", id, "ZP_REMOVE_RESET_ROUND")
}
}

g_soldier[id] = true
}

public zp_round_started(mode)
{
if (mode == MODE_INFECTION || mode == MODE_MULTI)
g_infround = true
else
{
g_infround = false

if (get_pcvar_num(cvar_convert[0]))
{
static i

for (i = 0; i <= g_maxplayers; i++)
if (g_soldier[i])
zp_convert_rewards(i, health)
}
}
}

public zp_user_infected_post(id, infector, nemesis, assassin, bombardier)
{
if (!nemesis && !assassin && !bombardier)
g_zombie[id] = 1
else
g_zombie[id] = 2

g_soldier[id] = false

zp_reset_rewards(id)
}

public zp_user_humanized_post(id, survivor, sniper)
{
g_zombie[id] = false

if (get_pcvar_num(cvar_convert[0]) && g_last_human)
{
static i

for (i = 0; i <= g_maxplayers; i++)
if (zp_get_user_valid(i) && g_soldier[i])
zp_convert_rewards(i, armor)

g_last_human = false
}

if (zp_get_user_human_class(id) != g_hclass_soldier)
{
g_soldier[id] = false

zp_reset_rewards(id)
}
else
{
if (survivor || sniper)
{
if ((g_total_earned[id][armor] || g_total_earned[id][health]) && (survivor &&
get_pcvar_num(cvar_convert[1]) || sniper && get_pcvar_num(cvar_convert[2])))
{
zp_set_user_health(id, get_user_health(id) + g_total_earned[id][armor] + g_total_earned[id][health])
zp_emit_body_sound(id, health)
zp_colored_print(id, "%L", id, "ZP_CONVERTED_TO_HEALTH", (g_total_earned[id][armor] + g_total_earned[id][health]))

zp_reset_rewards(id)
}

g_soldier[id] = false

return;
}

g_soldier[id] = true
}
}

public zp_user_last_human(id)
{
if (!get_pcvar_num(cvar_convert[0]))
return;

g_last_human = true

if (g_soldier[id])
zp_convert_rewards(id, health)
}

public zp_round_ended()
if (get_pcvar_num(cvar_convert[0]))
g_last_human = false

public zp_user_take_damage_post(id, inflictor, attacker, Float:damage)
{
if (!g_soldier[id])
return;

static dmg
dmg = floatround(damage)

if (zp_get_user_valid(inflictor) && g_zombie[inflictor] == 1 && g_infround && !zp_get_user_last_human(id))
{
if (g_total_earned[id][armor] - dmg > -1)
g_total_earned[id][armor] -= dmg
else
g_total_earned[id][armor] = 0
}
else if (!inflictor || (g_infround && zp_get_user_last_human(id) || !g_infround) || zp_get_user_valid(attacker) && g_zombie[attacker] > 1)
{
if (g_total_earned[id][health] - dmg > -1)
g_total_earned[id][health] -= dmg
else
g_total_earned[id][health] = 0
}
}

public zp_user_killed_post(victim, attacker)
{
g_zombie[victim] = false

if (g_soldier[victim])
{
g_soldier[victim] = false

zp_reset_rewards(victim)
}

if (!zp_get_user_valid(attacker) || !g_soldier[attacker] || victim == attacker)
return;

if (!zp_get_user_last_human(attacker) && g_infround)
{
zp_set_user_armor(attacker, get_user_armor(attacker) + cvar_reward)
g_total_earned[attacker][armor] += cvar_reward

zp_emit_body_sound(attacker, armor)
zp_colored_print(attacker, "%L", attacker, "ZP_GET_ARMOR", cvar_reward)
}
else
{
zp_set_user_health(attacker, get_user_health(attacker) + cvar_reward)
g_total_earned[attacker][health] += cvar_reward

zp_emit_body_sound(attacker, health)
zp_colored_print(attacker, "%L", attacker, "ZP_GET_HEALTH", cvar_reward)
}
}

zp_emit_body_sound(id, hp)
{
if (!hp)
emit_sound(id, CHAN_BODY, g_sound_armor, 1.0, ATTN_NORM, 0, PITCH_NORM)
else
emit_sound(id, CHAN_BODY, g_sound_health, 1.0, ATTN_NORM, 0, PITCH_NORM)
}

zp_convert_rewards(id, hp)
{
if (!hp)
{
if (!g_total_earned[id][health])
return;

zp_set_user_armor(id, get_user_armor(id) + g_total_earned[id][health])

if (zp_has_round_started() == 1)
zp_set_user_health(id, get_user_health(id) - g_total_earned[id][health])

g_total_earned[id][armor] += g_total_earned[id][health]

zp_emit_body_sound(id, armor)
zp_colored_print(id, "%L", id, "ZP_CONVERTED_TO_ARMOR", g_total_earned[id][health])

g_total_earned[id][health] = 0
}
else
{
if (!g_total_earned[id][armor])
return;

zp_set_user_health(id, get_user_health(id) + g_total_earned[id][armor])
zp_set_user_armor(id, get_user_armor(id) - g_total_earned[id][armor])

g_total_earned[id][health] += g_total_earned[id][armor]

zp_emit_body_sound(id, health)
zp_colored_print(id, "%L", id, "ZP_CONVERTED_TO_HEALTH", g_total_earned[id][armor])

g_total_earned[id][armor] = 0
}
}

zp_reset_rewards(id)
{
g_total_earned[id][armor] = 0
g_total_earned[id][health] = 0
}
Look a class.. for him ..

Last edited by SnowFake; 10-14-2015 at 11:29.
SnowFake is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-15-2015 , 03:52   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #4

So, your ZP 4.3 version is the modified version and support human class?
zmd94 is offline
SnowFake
Senior Member
Join Date: Oct 2012
Old 10-15-2015 , 05:22   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #5

yes ...
SnowFake is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-15-2015 , 06:27   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #6

Just try below for invisible human:

Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>

new g_hclass_invisible
new g_ability[33]
new Float:g_last[33]

new cvar_ability_time, cvar_invamount, cvar_cooldown

new const humanclass2_name[] = "Invisible Human"
new const humanclass2_info[] = "Invisible Ability+"
new const humanclass2_models[] = "leet"
new const humanclass2_handmodel[] = "v_knife.mdl"
const humanclass2_health = 50
const humanclass2_speed = 240
const Float:humanclass2_gravity = 1.0

public plugin_init()
{    
    register_plugin("[ZP] Human Class: Invisible", "1.0", "zmd94")
    
    register_clcmd("nightvision", "start_ability")
    
    cvar_ability_time = register_cvar("zp_invisible_duration", "15")
    cvar_invamount = register_cvar("zp_invisible_amount", "0")
    cvar_cooldown = register_cvar("zp_invisible_cooldown", "10")
}

public plugin_precache()
{
    g_hclass = zp_register_human_class(humanclass2_name, humanclass2_info, humanclass2_models, humanclass2_handmodel, humanclass2_health, humanclass2_speed, humanclass2_gravity)
}

public zp_user_infected_post(id, infector)
{
    ability_end(id)
}

public start_ability(id)
{
    if(!is_user_alive(id) || zp_get_user_zombie(id))
        return PLUGIN_HANDLED
    
    if(zp_get_user_human_class(id) == g_hclass)
    {    
        if(g_ability[id])
        {
            client_print(id, print_chat, "[ZP] You are already invisible.")
            return PLUGIN_HANDLED
        }
            
        static Float: i
        i = get_pcvar_float(cvar_cooldown)
            
        if (get_gametime() - g_last[id] < i) 
        {
            client_print(id, print_chat, "[ZP] Wait %.f seconds to use your ability!", get_pcvar_float(cvar_cooldown) - (get_gametime() - g_last[id]))
            return PLUGIN_HANDLED
        } 
        set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_pcvar_num(cvar_invamount))
                    
        set_hudmessage(200, 100, 0, -1.0, 0.15, 0, 0.0, 3.0, 0.01, 0.01, -1)
        show_hudmessage(id, "You are now invisible. Time to hunt!")
                    
        g_ability[id] = true
        set_task(get_pcvar_float(cvar_ability_time), "ability_end", id)
    }
    
    return PLUGIN_CONTINUE
}

public ability_end(id)
{
    if(is_user_alive(id))
    {
        set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 255)
        
        g_last[id] = get_gametime()
        g_ability[id] = false
    }
}
zmd94 is offline
SnowFake
Senior Member
Join Date: Oct 2012
Old 10-15-2015 , 06:52   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #7



Anyway i fix errors solo but this class was easy to convert..
zp_zhuman_equipped
teleport runner...

this 3 classes is so haaard for me to convert ..

EDIT:
Quote:
Health: 50 | Speed: 1067030938 | Gravity: 960
How i fix that bugg with speed ) ?
Edit2: Bugg on invisibiliti .. dont work O_o

For human i convert a class for zombie to human ) i think is ok (i test with bots .. they can hit me when i'm invisible .. so fuck ) but i will try with players)..

anyway the teleport, runner and equipped is hard to make for zp 4.3 ..

anyway TY zmd

Last edited by SnowFake; 10-15-2015 at 07:31.
SnowFake is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-15-2015 , 09:27   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #8

Just show code for below part:
Code:
Health: 50 | Speed: 1067030938 | Gravity: 960
zmd94 is offline
SnowFake
Senior Member
Join Date: Oct 2012
Old 10-15-2015 , 09:41   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #9

is your sma .. watch on him
you post it )
SnowFake is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-15-2015 , 19:50   Re: Convert clases from 5.0 to 4.3 :P
Reply With Quote #10

I don't find that code.
zmd94 is offline
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 12:57.


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