Raised This Month: $ Target: $400
 0% 

Suggestion / Subplugin Request [Request]zp_extra_item_leap for humans+cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pervade
BANNED
Join Date: Apr 2013
Old 04-23-2013 , 10:06   [Request]zp_extra_item_leap for humans+cvars
Reply With Quote #1

I would like to have this plugin ,i cant find it anywhere.Also the existing ones are only for zombies:$.I would appreciate any help.
Pervade is offline
bat
Veteran Member
Join Date: Jul 2012
Old 05-04-2013 , 02:19   Re: [Request]zp_extra_item_leap for humans+cvars
Reply With Quote #2

Try..
PHP Code:
/*
                   [ZP] Extra Item : Leap
                     (For Zombies Only)
                       by Fry!
    

    Description : 

            Do you want leap further? Now You can, for zombies are one special ability "Leap".
            It's now possible to upgrade your current leap to more stronger force, meanwhile it's possible
            upgrade to 1st level...

    Cvars :

            zp_leap_cost "9" - How much it costs.
            zp_leap_force "550" - How far zombie will jump
            zp_leap_height "255" - How high zombie will jump
            zp_leap_cooldown "5.0" - How long cooldown will be before you can use long jump again
        
        
    Chat commands :
    
            say leap - to buy it via chat
            
    Credits :

            Locks - for his Long Jump Plugin
            bmann_420 - for helping again ^^
            Mercylezz - for helping me with delay (thanks to him fixed one error and converted to fakemeta)

    Changelog :

            20/09/2008 - v1.0 - first release
            25/09/2008 - v1.1 - fixed that plugin not working only ammo packs waste.
            27/09/2008 - v1.2 - fixed that when have bought a jump pack it show to all players.
            04/10/2008 - v1.3 - added delay between long jump, force and height.
            08/10/2008 - v1.4 - fixed delay not working between jumps.
            12/10/2008 - v1.5 - fixed this last error and converted all to fakemeta
            15/11/2008 - v1.5.3 - added cvar how much it will cost, optimized code, changed plugin name.
            20/02/2009 - v1.5.7 - removed toggle cvar, changed chat function, changed plugin name, optimized code.
            15/09/2009 - v1.5.8 - 
                        - Fixed : Cooldown, could waste ammo packs if you already had leap.
                        - Changed : removed comments, chat command to ' leap '.
                        - Added : Upgraded version for leap and hud message for leap to see how far you can jump.
            26/12/2009 - v1.5.8 - Updated @ web (To remind myself)
*/

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

#define PLUGIN "[ZP] Extra Item : Leap"
#define VERSION "1.5.8"
#define AUTHOR "Fry!"

new g_item_name[] = "Leap Pack"
new g_item_name2[] = "Leap Upgrade"
new g_itemid_leapg_itemid_leap_upgradeg_leap_costg_leap_forceg_leap_heightg_leap_cooldown
new bool:g_hasLeap[33], bool:g_hasLeapUpgrade[33]
new 
Float:g_last_Leap[33

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar("zp_extra_leap",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
    
    
g_leap_cost register_cvar("zp_leap_cost""9")
    
g_leap_force register_cvar("zp_leap_force""550")
    
g_leap_height register_cvar("zp_leap_height""255")
    
g_leap_cooldown register_cvar("zp_leap_cooldown""5.0")
    
    
g_itemid_leap zp_register_extra_item(g_item_nameget_pcvar_num(g_leap_cost), ZP_TEAM_HUMAN)
    
g_itemid_leap_upgrade zp_register_extra_item(g_item_name2get_pcvar_num(g_leap_cost) * 2ZP_TEAM_HUMAN)
    
    
register_clcmd("say leap""buy_leap")
    
    
register_event("DeathMsg""death""a")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
register_forward(FM_PlayerPostThink"fw_PlayerPostThink"1)
}

public 
client_connect(id)
{
    
g_hasLeap[id] = false
    g_hasLeapUpgrade
[id] = false
}
    
public 
client_disconnect(id)
{
    
g_hasLeap[id] = false
    g_hasLeapUpgrade
[id] = false
}

public 
death()
{
    
g_hasLeap[read_data(2)] = false
}

public 
zp_user_humanized_post(id)
{
    
g_hasLeap[id] = false
    g_hasLeapUpgrade
[id] = false
}

public 
event_round_start()
{
    for (new 
1<= 32i++)
    {
        
g_hasLeap[i] = false
        g_hasLeapUpgrade
[i] = false
    
}
}

public 
zp_extra_item_selected(playeritemid)
{
    if (
g_hasLeap[player] && g_hasLeapUpgrade[player])
    {
        
zp_set_user_ammo_packs(playerzp_get_user_ammo_packs(player) + get_pcvar_num(g_leap_cost))
        
client_print(playerprint_center"[ZP] You already has Upgraded Leap!")
        
        return 
PLUGIN_HANDLED
    
}
    
    if (
itemid == g_itemid_leap)
    {
        
g_hasLeap[player] = true
        g_hasLeapUpgrade
[player] = false
        show_leap_status
(player)
        
client_print(playerprint_chat,"[ZP] You have bought a Jump Pack. To use it, press duck and jump while moving forward.")
    }
    
    if (
itemid == g_itemid_leap_upgrade)
    {
        
g_hasLeap[player] = false
        g_hasLeapUpgrade
[player] = true
        
//show_leap_status(player)
        
client_print(playerprint_chat"[ZP] You just Upgraded your Leap")
    }
    
    return 
PLUGIN_HANDLED
}    

public 
buy_leap(id)
{
    if (
g_hasLeap[id])
    {
        
client_print(idprint_chat"[ZP] You have already purchased a leap.")
        return 
PLUGIN_HANDLED
    
}
    
    if (!
is_user_alive(id))
    {
        
client_print(idprint_chat"[ZP] You can't buy Jump Pack because You are dead.")
        return 
PLUGIN_HANDLED
    
}
    
    if (
zp_get_user_zombie(id))
    {
        
client_print(idprint_chat"[ZP] You can't buy Jump Pack because You are not a human.")
        return 
PLUGIN_HANDLED
    
}
    
    new 
money zp_get_user_ammo_packs(id)
    new 
cost get_pcvar_num(g_leap_cost)
    
    if (
money cost)
    {
        
client_print(idprint_chat"[ZP] You don't have enough ammo packs to buy a jumppack. (%i needed)."cost)
        return 
PLUGIN_HANDLED
    
}
    
    
g_hasLeap[id] = true
    g_hasLeapUpgrade
[id] = false
    
    zp_set_user_ammo_packs
(idmoney cost)
    
show_leap_status(id)
    
client_print(idprint_chat"[ZP] You have bought a Jump Pack. To use it, press duck and jump while moving forward.")
    
    return 
PLUGIN_HANDLED
}
    
public 
fw_PlayerPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
if (allow_LongJump(id))
    {
        if (
g_hasLeap[id])
        {
            static 
Float:velocity[3]
            
velocity_by_aim(idget_pcvar_num(g_leap_force), velocity)
        
            
velocity[2] = get_pcvar_float(g_leap_height)
        
            
set_pev(idpev_velocityvelocity)
        
            
g_last_Leap[id] = get_gametime()
        }
    }

    return 
FMRES_IGNORED
}

public 
fw_PlayerPostThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
        
    
if (allow_LongJump(id))
    {
        if (
g_hasLeapUpgrade[id])
        {
            static 
Float:velocity[3]
            
velocity_by_aim(idget_pcvar_num(g_leap_force) + 125velocity)
        
            
velocity[2] = get_pcvar_float(g_leap_height) + 65
        
            set_pev
(idpev_velocityvelocity)
        
            
g_last_Leap[id] = get_gametime()
        }
    }
    
    return 
FMRES_IGNORED
}

allow_LongJump(id)
{
    if (!
g_hasLeap[id] && !g_hasLeapUpgrade[id])
        return 
false
    
    
if (!(pev(idpev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80)
        return 
false
    
    
static buttons
    buttons 
pev(idpev_button)
    
    if (!
is_user_bot(id) && (!(buttons IN_JUMP) || !(buttons IN_DUCK)))
        return 
false
    
    
if (get_gametime() - g_last_Leap[id] < get_pcvar_float(g_leap_cooldown))
        return 
false
    
    
return true
}

public 
show_leap_status(id)
{
    if (
g_hasLeap[id])
    {
        
set_hudmessage(1000150, -1.01.006.01.00.10.2)
        
show_hudmessage(id"Your Max Leap Force is %i"get_pcvar_num(g_leap_force))
    }
    
    else if (
g_hasLeapUpgrade[id])
    {
        
set_hudmessage(2001000, -1.01.006.01.00.10.2)
        
show_hudmessage(id"Your Max Leap Force is %i + 125"get_pcvar_num(g_leap_force))
    }
    
    
set_task(0.1"show_leap_status"id)
    
    return 
PLUGIN_HANDLED
}

stock fm_get_speed(entity)
{
    static 
Float:velocity[3]
    
pev(entitypev_velocityvelocity)
    
    return 
floatround(vector_length(velocity))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
__________________
bat is offline
Send a message via Skype™ to bat
Pervade
BANNED
Join Date: Apr 2013
Old 05-05-2013 , 13:42   Re: [Request]zp_extra_item_leap for humans+cvars
Reply With Quote #3

You just made it , thank you bat.
Pervade 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 05:47.


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