Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-29-2010 , 06:48   [ZP] Class: Frost Zombie (Can freeze human. Block fire)
Reply With Quote #1

Frost Zombie

This zombie class can freeze human by aiming the target
And Block Fire(+attack1 & +attack2) Of The Human

This Zombie Class Made By Excalibur.007 (Remake By me)

USE:
- Press "E" to Use Freeze

Cvar:

zp_frost_distance 400 - Distance To Freeze (Default: 400)
zp_frost_cooldown 10.0 - Time Waiting to use the next time (Default: 10.0)
zp_frost_freeze_time 5.0 - How Long To Freeze a human (Default: 5.0)


------------------ Important ------------------------------
To USE This class. You Must Use "[New Natives]Zombie Plague 4.3[v1.8]"
-> http://forums.alliedmods.net/showthread.php?t=119431
THIS IS NOT A PLUGIN. THIS IS A EDITED ZOMBIE PLAGUE 4.3 WITH NEW NATIVES

=> If you didn't Use "[New Natives]Zombie Plague 4.3[v1.8]".
You can't compile . And can't use Frost Zombie
----------------------------------------------------------

I Tested This Class => Working

ScreenShots:


I made a models for Frost And hands :




What do you think

DOWNLOAD:
Frost_Zombie Player Models : http://www.mediafire.com/?e0frcdtlqvil26u
Hand: N/A

Last Update: 22/10/2010
Code:
- Fix bug "all zombie got frost"
Attached Files
File Type: sma Get Plugin or Get Source (zp_class_frost_v2.sma - 6101 views - 4.6 KB)

Last edited by dias; 10-22-2010 at 06:23.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 09-29-2010 , 07:13   Re: [ZP] Class: Frost Zombie (Remake)
Reply With Quote #2

It's a bad idea that client_PreThink is used. Use FM_CmdStart. Like I said it's just an example of using the native.
EDIT: I see FM_CmdStart but, what I dont see anything related to my use_cmd.
EDIT2: Use get_gametime instead of set_task for cooldown.
EDIT3: Ok I see the point of FM_CmdStart. Use FM_CmdStart for IN_USE thingy dont use it on client_PreThink.

Last edited by Excalibur.007; 09-29-2010 at 07:16.
Excalibur.007 is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-29-2010 , 07:15   Re: [ZP] Class: Frost Zombie (Remake)
Reply With Quote #3

What ?.
How to fix this :-ss
-----------------------------
I Tested. It's Work very good

Last edited by dias; 09-29-2010 at 07:22.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Ryokin
Senior Member
Join Date: Jan 2010
Old 09-29-2010 , 07:25   Re: [ZP] Class: Frost Zombie (Remake)
Reply With Quote #4

Quote:
Originally Posted by dias View Post
What ?.
How to fix this :-ss
-----------------------------
I Tested. It's Work very good
- replace client prethink by fm_cmdstart
- when frost human, hook a float = get_gametime, then check if ( get_gametime - hooked float <cooldown) then....
__________________
NH4CL + NaOH -> NH3 + H2O + NaCL
Ryokin is offline
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 #5

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
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-29-2010 , 07:28   Re: [ZP] Class: Frost Zombie (Remake)
Reply With Quote #6

Oh Thanks
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 09-29-2010 , 07:33   Re: [ZP] Class: Frost Zombie (Remake)
Reply With Quote #7

Seems you uploaded the new 1 .
Anyway, let me tell you the previous code and the new code difference.

Previous Code:
- Checks every 0.1 sec for IN_USE pressed
- Engine & FM(Bad(A lot CPU usage), only use 1 of them)
- Uses set_task.(Many natives is used, e.g. is_user_connected, is_user_alive, e.t.c)

New Code:
- Checks ONLY when a button is pressed.
- Only FM is used.
- Only get_gametime() is used

Last edited by Excalibur.007; 09-29-2010 at 07:35.
Excalibur.007 is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-29-2010 , 07:39   Re: [ZP] Class: Frost Zombie
Reply With Quote #8

Hey. 007: do you have yahoo id ?
I need your help to make some plugins for my sv

Last edited by dias; 09-29-2010 at 07:41.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
FeAr.1337
Senior Member
Join Date: Sep 2010
Old 09-29-2010 , 07:44   Re: [ZP] Class: Frost Zombie
Reply With Quote #9

i cant compile it it isnt working
FeAr.1337 is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-29-2010 , 07:49   Re: [ZP] Class: Frost Zombie
Reply With Quote #10

I told you. Use new includes file and new natives zombie plague .
If Use Default ZombiePlague Includes and Old Natives => You can't Compile

-----------------------------------------------------------
To USE This class. You Must Use "[New Natives]Zombie Plague 4.3[v1.8]"
-> http://forums.alliedmods.net/showthread.php?t=119431
THIS IS NOT A PLUGIN. THIS IS A EDITED ZOMBIE PLAGUE 4.3 WITH NEW NATIVES
-----------------------------------------------------------

Last edited by dias; 09-29-2010 at 07:53.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Old 09-29-2010, 07:53
FeAr.1337
This message has been deleted by FeAr.1337.
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 06:14.


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