Raised This Month: $ Target: $400
 0% 

[ZP] Extra Item: Wallclimb


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-20-2011 , 09:21   Re: [ZP] Extra Item: Wallclimb
Reply With Quote #9

Quote:
Originally Posted by samurake View Post
can you make this into an addon for all zombie?
try this :/
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <zombieplague>

new bool:g_WallClimb[33]
new 
Float:g_wallorigin[32][3]
new 
g_maxplayers

public plugin_init() 
{
    
register_plugin("[ZP] Addon Item: Wall climb ""1.0""Python1320 & Accelerator")
    
register_forward(FM_Touch"fwd_touch")
    
register_forward(FM_PlayerPreThink"fwd_playerprethink")
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
    
g_maxplayers get_maxplayers()
}

public 
zp_user_infected_post(idinfector)
    
g_WallClimb[id] = true

public zp_user_humanized_post(idsurvivor)
    
g_WallClimb[id] = false

public fw_PlayerKilled(victimattackershouldgib)
    
g_WallClimb[victim] = false

public zp_round_ended(winteam)
{
    for (new 
id=1id<=g_maxplayersid++)
        
g_WallClimb[id] = true
}

public 
client_connect(id)
    
g_WallClimb[id] = false

public fwd_touch(idworld)
{
    if(!
is_user_alive(id) || !g_WallClimb[id])
        return 
FMRES_IGNORED
        
    pev
(idpev_origing_wallorigin[id])

    return 
FMRES_IGNORED
}

public 
wallclimb(idbutton)
{
    static 
Float:origin[3]
    
pev(idpev_originorigin)

    if(
get_distance_f(origing_wallorigin[id]) > 25.0)
        return 
FMRES_IGNORED  // if not near wall
    
    
if(fm_get_entity_flags(id) & FL_ONGROUND)
        return 
FMRES_IGNORED
        
    
if(button IN_FORWARD)
    {
        static 
Float:velocity[3]
        
velocity_by_aim(id120velocity)
        
fm_set_user_velocity(idvelocity)
    }
    else if(
button IN_BACK)
    {
        static 
Float:velocity[3]
        
velocity_by_aim(id, -120velocity)
        
fm_set_user_velocity(idvelocity)
    }
    return 
FMRES_IGNORED
}    

public 
fwd_playerprethink(id
{
    if(!
g_WallClimb[id]) 
        return 
FMRES_IGNORED
    
    
new button fm_get_user_button(id)
    
    if(
button IN_USE//Use button = climb
        
wallclimb(idbutton)

    return 
FMRES_IGNORED

Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
 



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 15:44.


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