Junior Member
|
01-17-2018
, 05:13
Why no one is Helping me :"(?
|
#1
|
As I am new in editing Plugins
So I cant figure out how to do this
I have scripting of frost zm and zm classes but dont know how to add frost zombie in zm classes with its ability
Frost Scripting (by excalibue.007):
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_frost, frostsprite
new pcvar_distance, pcvar_cooldown, pcvar_freeze
new Bloqueado[33]
new Float:gLastUseCmd[ 33 ]
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_class( zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback )
frostsprite = precache_model( "sprites/nhth1.spr" )
}
public zp_user_infected_post( player, infector )
{
if( zp_get_user_zombie_class( player ) == g_zclass_frost )
{
client_print( player, print_chat, "[ZP] Press E to use frost!" )
}
}
public use_cmd( player )
{
if( !is_user_alive( player ) || !zp_get_user_zombie( player ) || zp_get_user_zombie_class( player ) != g_zclass_frost || zp_get_user_nemesis( player ))
return PLUGIN_HANDLED
if( get_gametime( ) - gLastUseCmd[ player ] < get_pcvar_float( pcvar_cooldown ) )
{
client_print( player, print_chat, "[ZP] You need to wait for %.f0 sec. to use froze again!", get_pcvar_float( pcvar_cooldown ) - ( get_gametime( ) - gLastUseCmd[ player ] ) )
return PLUGIN_HANDLED
}
gLastUseCmd[ player ] = get_gametime( )
new target, body
get_user_aiming( player, target, body, get_pcvar_num( pcvar_distance ) )
if( is_user_alive( target ) && !zp_get_user_zombie( target ) )
{
sprite_control( player )
zp_set_user_frozen( target, 1 )
Bloqueado[target] = true
set_task( get_pcvar_float( pcvar_freeze ), "unfrozen_user", target )
}
else
{
sprite_control( player )
}
return PLUGIN_HANDLED
}
public unfrozen_user( target )
{
zp_set_user_frozen( target, 0 )
Bloqueado[target] = false
}
public te_spray( args[ ] )
{
message_begin( MSG_BROADCAST,SVC_TEMPENTITY )
write_byte( 120 ) // Throws a shower of sprites or models
write_coord( args[ 0 ] ) // start pos
write_coord( args[ 1 ] )
write_coord( args[ 2 ] )
write_coord( args[ 3 ] ) // velocity
write_coord( args[ 4 ] )
write_coord( args[ 5 ] )
write_short( frostsprite ) // spr
write_byte( 8 ) // count
write_byte( 70 ) // speed
write_byte( 100 ) //(noise)
write_byte( 5 ) // (rendermode)
message_end( )
return PLUGIN_CONTINUE
}
public sqrt( num )
{
new div = num
new result = 1
while( div > result )
{
div = ( div + result ) / 2
result = num / div
}
return div
}
public sprite_control( player )
{
new vec[ 3 ]
new aimvec[ 3 ]
new velocityvec[ 3 ]
new length
new speed = 10
get_user_origin( player, vec )
get_user_origin( player, aimvec, 2 )
velocityvec[ 0 ] = aimvec[ 0 ] - vec[ 0 ]
velocityvec[ 1 ] = aimvec[ 1 ] - vec[ 1 ]
velocityvec[ 2 ] = aimvec[ 2 ] - vec[ 2 ]
length = sqrt( velocityvec[ 0 ] * velocityvec[ 0 ] + velocityvec[ 1 ] * velocityvec[ 1 ] + velocityvec[ 2 ] * velocityvec[ 2 ] )
velocityvec[ 0 ] = velocityvec[ 0 ] * speed / length
velocityvec[ 1 ] = velocityvec[ 1 ] * speed / length
velocityvec[ 2 ] = velocityvec[ 2 ] * speed / length
new args[ 8 ]
args[ 0 ] = vec[ 0 ]
args[ 1 ] = vec[ 1 ]
args[ 2 ] = vec[ 2 ]
args[ 3 ] = velocityvec[ 0 ]
args[ 4 ] = velocityvec[ 1 ]
args[ 5 ] = velocityvec[ 2 ]
set_task( 0.1, "te_spray", 0, args, 8, "a", 2 )
}
public fw_Start(id, uc_handle, seed)
{
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) && zp_get_user_zombie_class(id) == g_zclass_frost && !zp_get_user_nemesis(id))
use_cmd(id)
}
Zm Classes scripting:
PHP Code:
/*================================================================================
-----------------------------------
-*- [BB] Default Zombie Classes -*-
-----------------------------------
~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~
This plugin adds the default zombie classes from Zombie Plague
into Base Builder. All credit belongs to MeRcyLeZZ.
All classes have been balanced, but feel free to edit them if
you are not satisfied.
================================================================================*/
#include <amxmodx>
#include <basebuilder>
#include <hamsandwich>
#include <fun>
#include <cstrike>
/*================================================================================
[Plugin Customization]
=================================================================================*/
// Classic Zombie Attributes
new const zclass1_name[] = { "Classic Zombie" }
new const zclass1_info[] = { "=Standard=" }
new const zclass1_model[] = { "bb_classic22" }
new const zclass1_clawmodel[] = { "v_classic22" }
const zclass1_health = 4000
const zclass1_speed = 260
const Float:zclass1_gravity = 1.0
const zclass1_adminflags = ADMIN_ALL
// Fast Zombie Attributes
new const zclass2_name[] = { "Fast Zombie" }
new const zclass2_info[] = { "HP- Speed+++ Jump+" }
new const zclass2_model[] = { "bb_fast" }
new const zclass2_clawmodel[] = { "v_bloodyhands" }
const zclass2_health = 2500
const zclass2_speed = 325
const Float:zclass2_gravity = 1.0
const zclass2_adminflags = ADMIN_ALL
// Jumper Zombie Attributes
new const zclass3_name[] = { "Jumper Zombie" }
new const zclass3_info[] = { "HP+ Speed+ Jump+++" }
new const zclass3_model[] = { "bb_jumper" }
new const zclass3_clawmodel[] = { "v_bloodyhands" }
const zclass3_health = 3000
const zclass3_speed = 285
const Float:zclass3_gravity = 0.5
const zclass3_adminflags = ADMIN_ALL
// Tanker Zombie Attributes
new const zclass4_name[] = { "Tanker Zombie" }
new const zclass4_info[] = { "HP+++ Speed- Jump+" }
new const zclass4_model[] = { "bb_tanker22" }
new const zclass4_clawmodel[] = { "v_bloodyhands" }
const zclass4_health = 5500
const zclass4_speed = 205
const Float:zclass4_gravity = 1.0
const zclass4_adminflags = ADMIN_ALL
// Jockey Zombie Attributes
new const zclass5_name[] = { "Jockey Zombie" }
new const zclass5_info[] = { "HP-- Speed++ Jump++" }
new const zclass5_model[] = { "bb_jockey22" }
new const zclass5_clawmodel[] = { "v_jockey22" }
const zclass5_health = 2000
const zclass5_speed = 300
const Float:zclass5_gravity = 0.5
const zclass5_adminflags = ADMIN_ALL
// Agent-1 Zombie Attributes
new const zclass6_name[] = { "Agent-1 Zombie" }
new const zclass6_info[] = { "HP+ Speed+ Jump+" }
new const zclass6_model[] = { "bb_agent1_22" }
new const zclass6_clawmodel[] = { "v_knife" }
const zclass6_health = 3500
const zclass6_speed = 290
const Float:zclass6_gravity = 1.0
const zclass6_adminflags = ADMIN_ALL
// Agent-2 Zombie Attributes
new const zclass7_name[] = { "Agent-2 Zombie" }
new const zclass7_info[] = { "HP+ Speed+ Jump+" }
new const zclass7_model[] = { "bb_agent2_22" }
new const zclass7_clawmodel[] = { "v_knife" }
const zclass7_health = 3500
const zclass7_speed = 290
const Float:zclass7_gravity = 1.0
const zclass7_adminflags = ADMIN_ALL
// Lysing Zombie Attributes
new const zclass8_name[] = { "Lysing Zombie" }
new const zclass8_info[] = { "HP++ Speed++ Jump++" }
new const zclass8_model[] = { "bb_lysing22" }
new const zclass8_clawmodel[] = { "v_lysing22" }
const zclass8_health = 4500
const zclass8_speed = 299
const Float:zclass8_gravity = 0.7
const zclass8_adminflags = ADMIN_ALL
#define TANK_ARMOR 200
/*============================================================================*/
new g_zclass_tanker
// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
register_plugin("[BB] Default Zombie Classes", "6.5", "Tirant")
// Register all classes
bb_register_zombie_class(zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, 0.0, zclass1_adminflags)
bb_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, 0.0, zclass2_adminflags)
bb_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, 0.0, zclass3_adminflags)
g_zclass_tanker = bb_register_zombie_class(zclass4_name, zclass4_info, zclass4_model, zclass4_clawmodel, zclass4_health, zclass4_speed, zclass4_gravity, 0.0, zclass4_adminflags)
bb_register_zombie_class(zclass5_name, zclass5_info, zclass5_model, zclass5_clawmodel, zclass5_health, zclass5_speed, zclass5_gravity, 0.0, zclass5_adminflags)
bb_register_zombie_class(zclass6_name, zclass6_info, zclass6_model, zclass6_clawmodel, zclass6_health, zclass6_speed, zclass6_gravity, 0.0, zclass6_adminflags)
bb_register_zombie_class(zclass7_name, zclass7_info, zclass7_model, zclass7_clawmodel, zclass7_health, zclass7_speed, zclass7_gravity, 0.0, zclass7_adminflags)
bb_register_zombie_class(zclass8_name, zclass8_info, zclass8_model, zclass8_clawmodel, zclass8_health, zclass8_speed, zclass8_gravity, 0.0, zclass8_adminflags)
}
#if defined TANK_ARMOR
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
}
public ham_PlayerSpawn_Post(id)
{
if (!is_user_alive(id))
return ;
if (bb_is_user_zombie(id) && bb_get_user_zombie_class(id) == g_zclass_tanker)
{
give_item(id, "item_assaultsuit");
cs_set_user_armor(id, TANK_ARMOR, CS_ARMOR_VESTHELM);
}
}
#endif
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/
Last edited by RockyRock123; 01-17-2018 at 12:12.
|
|