Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Class: Frost Zombie (Can freeze human. Block fire)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 09-29-2010 , 07:26   Re: [ZP] Class: Frost Zombie (Remake)
Reply With Quote #7

Done.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

new const zclass_name[ ] = "Frost Zombie"
new const zclass_info[ ] = "Press E to use frost"
new const zclass_model[ ] = "frost_zombie"
new const zclass_clawmodel[ ] = "v_knife_frost.mdl"
const zclass_health 1000
const zclass_speed 240
const Float:zclass_gravity 0.5
const Float:zclass_knockback 1.0

new g_zclass_frostfrostsprite
new pcvar_distancepcvar_cooldownpcvar_freeze
new Bloqueado[33]
new 
Float:gLastUseCmd33 ]

public 
plugin_init( )
{
    
register_plugin"[ZP] Zombie Class: Frost Zombie""1.0""007" )
    
    
pcvar_distance register_cvar"zp_frost_distance""400" )
    
pcvar_cooldown register_cvar"zp_frost_cooldown""10.0" )
    
pcvar_freeze register_cvar"zp_frost_freeze_time""5.0" )
    
register_forward(FM_CmdStart"fw_Start")
}

public 
plugin_precache( )
{
    
g_zclass_frost zp_register_zombie_classzclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback )
    
frostsprite precache_model"sprites/nhth1.spr" )
}

public 
zp_user_infected_postplayerinfector )
{
    if( 
zp_get_user_zombie_classplayer ) == g_zclass_frost )
    {
        
client_printplayerprint_chat"[ZP] Press E to use frost!" )
    }
}

public 
use_cmdplayer )
{
    
    if( !
is_user_aliveplayer ) || !zp_get_user_zombieplayer ) )
        return 
PLUGIN_HANDLED
    
    
if( get_gametime( ) - gLastUseCmdplayer ] < get_pcvar_floatpcvar_cooldown ) )
    {
        
client_printplayerprint_chat"[ZP] You need to wait for %.f0 sec. to use froze again!"get_pcvar_floatpcvar_cooldown ) - ( get_gametime( ) - gLastUseCmdplayer ] ) )
        return 
PLUGIN_HANDLED
    
}
    
    
gLastUseCmdplayer ] = get_gametime( )
    
    new 
targetbody
    get_user_aiming
playertargetbodyget_pcvar_numpcvar_distance ) )
    
    if( 
is_user_alivetarget ) && !zp_get_user_zombietarget ) )
    {
        
sprite_controlplayer )
        
zp_set_user_frozentarget)
        
Bloqueado[target] = true
        set_task
get_pcvar_floatpcvar_freeze ), "unfrozen_user"target )
    }
    else
    {
        
sprite_controlplayer )
    }
    return 
PLUGIN_HANDLED
}

public 
unfrozen_usertarget )
{
    
zp_set_user_frozentarget)
    
Bloqueado[target] = false
}

public 
te_sprayargs[ ] )
{
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY )
    
write_byte120 // Throws a shower of sprites or models
    
write_coordargs] ) // start pos
    
write_coordargs] )
    
write_coordargs] )
    
write_coordargs] ) // velocity
    
write_coordargs] )
    
write_coordargs] )
    
write_shortfrostsprite // spr
    
write_byte// count
    
write_byte70 // speed
    
write_byte100 //(noise)
    
write_byte// (rendermode)
    
message_end( )
    
    return 
PLUGIN_CONTINUE
}

public 
sqrtnum )
{
    new 
div num
    
new result 1
    
while( div result )
    {
        
div = ( div result ) / 2
        result 
num div
    
}
    return 
div
}

public 
sprite_controlplayer )
{
    new 
vec]
    new 
aimvec]
    new 
velocityvec]
    new 
length
    
new speed 10
    
    get_user_origin
playervec )
    
get_user_originplayeraimvec)
    
    
velocityvec] = aimvec] - vec]
    
velocityvec] = aimvec] - vec]
    
velocityvec] = aimvec] - vec]
    
length sqrtvelocityvec] * velocityvec] + velocityvec] * velocityvec] + velocityvec] * velocityvec] )
    
velocityvec] = velocityvec] * speed length
    velocityvec
] = velocityvec] * speed length
    velocityvec
] = velocityvec] * speed length
    
    
new args]
    
args] = vec]
    
args] = vec]
    
args] = vec]
    
args] = velocityvec]
    
args] = velocityvec]
    
args] = velocityvec]
    
    
set_task0.1"te_spray"0args8"a")
    
}

public 
fw_Start(iduc_handleseed)
{
    new 
button get_uc(uc_handle,UC_Buttons)
    
    if(
Bloqueado[id] && !zp_get_user_zombie(id) && (button IN_ATTACK || button IN_ATTACK2))
        
set_uc(uc_handle,UC_Buttons,(button & ~IN_ATTACK) & ~IN_ATTACK2)
    
    if(
zp_get_user_zombie(id) && (button IN_USE))
        
use_cmd(id)

And use english inside your code. I dont understand what is "Bloqueado", as I am lazy to check using translator
Excalibur.007 is offline
 



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:41.


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