Raised This Month: $ Target: $400
 0% 

add vip class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chasper
Member
Join Date: Dec 2012
Location: Hungary
Old 07-29-2013 , 07:32   add vip class
Reply With Quote #1

Code:
/*================================================================================
	
	-----------------------------------
	-*- [ZP] Dragon Zombie -*-
	-----------------------------------
	
	~~~~~~~~~~~~~~~
	- Description -
	~~~~~~~~~~~~~~~
	
	This plugin add new class zombie: Dragon Zombie.
	
================================================================================*/

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <cstrike>
#include <fun>
#include <xs>

new const ball_name[] = "dragon_ball";
new const ball_model[] = "models/w_hiddentail.mdl";
new const ball_firespritemdl[] = "sprites/flame2.spr";
new const ball_spriteexplodemdl[] = "sprites/zerogxplode.spr"

new const zclass_name[] = { "Dragon Zombie" } // name
new const zclass_info[] = { "Can throw fire balls." } // description
new const zclass_model[] = { "zombie_source1" } // model
new const zclass_clawmodel[] = { "v_knife_spider.mdl" } // claw model
const zclass_health = 2000 // health
const zclass_speed = 290 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.0 // knockback

new sprFlame, sprSmoke

new g_zclassdragon
new cvar_dragondmg , cvar_dragondelay , cvar_dragonvelocity  , cvar_dragonballhealth , cvar_dragonballradius , cvar_dragonballpower , cvar_burndmg , cvar_burntime , cvar_burn
new g_msgScreenShake , g_smoke , sTrail , ball_firesprite , ball_spriteexplode , g_explode[512] , g_can[33] , g_msgScoreInfo , g_roundend , bool:g_AlreadyBurn[ 33 ] , Time[ 33 ]

public plugin_init()
{
	register_plugin("[ZP] Zombie Class: Dragon Zombie", "0.1", "=)")

	cvar_dragondelay = register_cvar("zp_classdragon_delay","15")
	cvar_dragondmg = register_cvar("zp_classdragonball_dmg","70.0")
	cvar_dragonvelocity = register_cvar("zp_classdragonball_velocity","600")
	cvar_dragonballhealth = register_cvar("zp_classdragonball_health","6")
	cvar_dragonballradius = register_cvar("zp_classdragonball_radius","300.0")
	cvar_dragonballpower = register_cvar ( "zp_classdragonball_power", "800" )
	cvar_burn = register_cvar ( "zp_classdragonball_enable", "1" )
	cvar_burntime = register_cvar ( "zp_classdragonball_burntime", "15" )
	cvar_burndmg = register_cvar ( "zp_classdragonball_burndmg", "3" )

	register_touch(ball_name, "worldspawn",			"touchWorld")
	register_touch(ball_name, "func_wall",			"touchWorld")
	register_touch(ball_name, "func_door",			"touchWorld")
	register_touch(ball_name, "func_door_rotating", "touchWorld")
	register_touch(ball_name, "func_wall_toggle",	"touchWorld")
	register_touch(ball_name, "func_breakable",		"touchWorld")
	register_think(ball_name,"ball_think")

	register_clcmd("drop","dragon_cmd")
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

	RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")

	g_msgScoreInfo = get_user_msgid("ScoreInfo")
	g_msgScreenShake = get_user_msgid("ScreenShake")

}

public plugin_precache()
{
	precache_model(ball_model)
	g_smoke = precache_model( "sprites/steam1.spr" );
	sTrail = precache_model("sprites/laserbeam.spr")
	ball_firesprite = precache_model(ball_firespritemdl)
	ball_spriteexplode  = precache_model(ball_spriteexplodemdl)

	sprFlame = precache_model( "sprites/flame.spr" )
	sprSmoke = precache_model( "sprites/black_smoke3.spr" )

	g_zclassdragon = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)	
}
public dragon_cmd( id )
{
	if( !is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclassdragon || zp_get_user_nemesis(id))
		return PLUGIN_CONTINUE;

	if(g_can[id]) 
	{
		client_print(id,print_center,"You cannot use ability now. Wait %d sec.",g_can[id])
		return PLUGIN_HANDLED;
	}

	static Float:origin[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3];
	static Float:OriginX[3]
	pev(id, pev_v_angle, angles);
	pev(id, pev_origin, OriginX);
	engfunc(EngFunc_MakeVectors, angles);

	global_get(glb_v_forward, v_forward);
	global_get(glb_v_right, v_right);
	global_get(glb_v_up, v_up);

	//m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
	pev(id, pev_origin, player_origin);
	pev(id, pev_view_ofs, player_view_offset);
	xs_vec_add(player_origin, player_view_offset, gun_position);

	xs_vec_mul_scalar(v_forward, 13.0, v_forward);
	xs_vec_mul_scalar(v_right, 0.0, v_right);
	xs_vec_mul_scalar(v_up, 5.0, v_up);

	xs_vec_add(gun_position, v_forward, origin);
	xs_vec_add(origin, v_right, origin);
	xs_vec_add(origin, v_up, origin);

	new Float:StartOrigin[3]
			
	StartOrigin[0] = origin[0];
	StartOrigin[1] = origin[1];
	StartOrigin[2] = origin[2];


	new Float:fVelocity[3] , Float:flOrigin[3] , Float:flAngle[3]
	pev(id,pev_origin,flOrigin)
	pev(id,pev_angles,flAngle)

	new ball = create_entity("info_target")
	
	if (!ball) return PLUGIN_HANDLED

	g_explode[ball] = 0
	
	entity_set_string(ball, EV_SZ_classname, ball_name)
	
	entity_set_model(ball, ball_model)
	
	entity_set_origin(ball, StartOrigin)
	
	entity_set_vector(ball, EV_VEC_angles, flAngle)
	
	new Float:MinBox[3] = {-1.0, -1.0, -1.0}
	new Float:MaxBox[3] = {1.0, 1.0, 1.0}
	entity_set_vector(ball, EV_VEC_mins, MinBox)
	entity_set_vector(ball, EV_VEC_maxs, MaxBox)
	
	entity_set_int(ball, EV_INT_solid, SOLID_SLIDEBOX)
	
	entity_set_int(ball, EV_INT_movetype, MOVETYPE_BOUNCE)
	
	entity_set_edict(ball, EV_ENT_owner, id)
	
	entity_set_int(ball, EV_INT_effects, EF_BRIGHTLIGHT)
	
	VelocityByAim(id, get_pcvar_num(cvar_dragonvelocity ), fVelocity)
	entity_set_vector(ball , EV_VEC_velocity, fVelocity)
	
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_BEAMFOLLOW) // Temporary entity ID
	write_short(ball) // Entity
	write_short(sTrail) // Sprite index
	write_byte(10) // Life
	write_byte(3) // Line width
	write_byte(255) // Red
	write_byte(150) // Green
	write_byte(20) // Blue
	write_byte(255) // Alpha
	message_end() 

	UTIL_PlayPlayerAnimation(id,10)
	UTIL_PlayWeaponAnimation(id,8)

	g_can[id] = get_pcvar_num(cvar_dragondelay)
	set_task(1.0,"ability_zero",id)

	entity_set_float(ball, EV_FL_health , get_pcvar_float(cvar_dragonballhealth))

	entity_set_float(ball, EV_FL_nextthink, get_gametime() + 0.1) 
	
	return PLUGIN_HANDLED;
}

public touchWorld(ball, world) {

	new Float:v[3]
	entity_get_vector(ball, EV_VEC_velocity, v)

	v[0] = (v[0] * 0.85)
	v[1] = (v[1] * 0.85)
	v[2] = (v[2] * 0.85)
	entity_set_vector(ball, EV_VEC_velocity, v)
	
	return PLUGIN_HANDLED
}

public event_round_start()
{
	new iEnt = FM_NULLENT;
	while( (iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", ball_name)) > 0 )
	{
		engfunc(EngFunc_RemoveEntity,iEnt)
	}	

	for(new i;i<=32;i++)
	{
		remove_task(i)
		g_can[i] = 0
		Time[ i ] = 0 
		g_AlreadyBurn[ i] = false
	}

	g_roundend = 0
}

public ball_think(ball)
{
	if(!is_valid_ent(ball))
		return;

	new Float:oldangles[3],Float:angles[3]
	pev(ball,pev_angles,oldangles)
	angles[0] = oldangles[0] + random_float(20.0,100.0)
	angles[1] = oldangles[1] + random_float(10.0,80.0)
	angles[2] = oldangles[2] + random_float(10.0,80.0)
	set_pev(ball,pev_angles,angles)

	new Float:v[3]
	entity_get_vector(ball, EV_VEC_velocity, v)

	if(v[2] < 40.0 && v[1] < 40.0 && v[0] < 40.0) 
	{
		if(!g_explode[ball])
		{
			set_task(0.5,"firesprite_ball",ball)
			g_explode[ball] = 1
		}

		entity_set_float(ball, EV_FL_health, entity_get_float(ball,EV_FL_health) - 0.2) 

		if(entity_get_float(ball,EV_FL_health) <= 0.0) 
		{
			ball_explode(ball)
			remove_entity(ball)
			g_explode[ball] = 0
			return;
		}
	}

	entity_set_float(ball, EV_FL_nextthink, get_gametime() + 0.1) 

}

public firesprite_ball(ball)
{
	if(!is_valid_ent(ball))
		return;

	new Float:flOrigin[3]
	pev(ball,pev_origin,flOrigin)

	engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 )
	write_byte ( TE_SPRITE )
	engfunc ( EngFunc_WriteCoord, flOrigin [ 0 ] )
	engfunc ( EngFunc_WriteCoord, flOrigin [ 1 ] )
	engfunc ( EngFunc_WriteCoord, flOrigin [ 2 ] + 45.0 )
	write_short ( ball_firesprite )
	write_byte ( 5 )
	write_byte ( 185 )
	message_end ( )

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( TE_SMOKE );
	engfunc ( EngFunc_WriteCoord, flOrigin [ 0 ] )
	engfunc ( EngFunc_WriteCoord, flOrigin [ 1 ] )
	engfunc ( EngFunc_WriteCoord, flOrigin [ 2 ] + 45.0 )
	write_short( g_smoke );
	write_byte( 10 );
	write_byte( 10 );
	message_end();

	if(entity_get_float(ball,EV_FL_health) >= 1.0) set_task(0.5,"firesprite_ball",ball)
}
public ball_explode ( Entity )
{
	if ( Entity < 0 )
		return
       
	static Float:flOrigin [ 3 ]
	pev ( Entity, pev_origin, flOrigin )
       
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_EXPLOSION) // Temporary entity ID
	engfunc(EngFunc_WriteCoord, flOrigin[0]) // engfunc because float
	engfunc(EngFunc_WriteCoord, flOrigin[1])
	engfunc(EngFunc_WriteCoord, flOrigin[2])
	write_short(ball_spriteexplode) // Sprite index
	write_byte(50) // Scale
	write_byte(15) // Framerate
	write_byte(0) // Flags
	message_end()
	
     	new iOwner = entity_get_edict ( Entity, EV_ENT_owner )
       
      	for ( new i = 1; i <= 32 ; i++ )
	{
		if ( !is_user_alive  ( i ) || zp_get_user_zombie( i ))
			continue
          
		new Float:flVictimOrigin [ 3 ]
		pev ( i, pev_origin, flVictimOrigin )
           
		new Float:flDistance = get_distance_f ( flOrigin, flVictimOrigin )   
           
		if ( flDistance <= get_pcvar_float(cvar_dragonballradius) )
		{
			static Float:flSpeed
			flSpeed = get_pcvar_float ( cvar_dragonballpower )
               
			static Float:flNewSpeed
			flNewSpeed = flSpeed * ( 1.0 - ( flDistance / get_pcvar_float(cvar_dragonballradius) ) )
               
			static Float:flVelocity [ 3 ]
			get_speed_vector ( flOrigin, flVictimOrigin, flNewSpeed, flVelocity )
               
			set_pev ( i, pev_velocity,flVelocity )

			message_begin(MSG_ONE, g_msgScreenShake, {0,0,0}, i)
			write_short(1<<14) // Amount
			write_short(1<<14) // Duration
			write_short(1<<14) // Frequency
			message_end()

			radius_damage_ab( flVictimOrigin, flOrigin , i , iOwner)

			if(!g_AlreadyBurn[ i ] && get_pcvar_num(cvar_burn ) == 1 ) 
			{
				// Burn / ON
				g_AlreadyBurn[ i ] = true
		
				// Set burn time
				Time[ i ] = get_pcvar_num(cvar_burntime)
		
				// Burn victim
				Burn( i )
			}
		}
	}
}       

public radius_damage_ab(Float:originF[3] , Float:flOrigin[3] , iVictim , iAttacker)
{
	if(g_roundend || !is_user_connected(iAttacker) || !is_user_connected(iVictim))
		return;

	new Float:dist = get_distance_f(originF, flOrigin);
	new Float:dmg = get_pcvar_float(cvar_dragondmg) - ( get_pcvar_float(cvar_dragondmg) / get_pcvar_float(cvar_dragonballradius) ) * dist;

	if(pev(iVictim,pev_health) - dmg <= 0) 
	{
		new headshot
		if(dist < 20.0) headshot = 1
		if(dist >= 20.0) headshot = 0
		message_begin( MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0)
		write_byte(iAttacker)
		write_byte(iVictim)
		write_byte(headshot)
		write_string("dragon")
		message_end()

		user_silentkill(iVictim)

		set_pev(iAttacker, pev_frags, float(pev(iAttacker, pev_frags) + 1))
		zp_set_user_ammo_packs(iAttacker, zp_get_user_ammo_packs(iAttacker) + 1)
		fm_cs_set_user_deaths(iVictim, cs_get_user_deaths(iVictim) + 1)

		message_begin(MSG_BROADCAST, g_msgScoreInfo)
		write_byte(iAttacker) // id
		write_short(pev(iAttacker, pev_frags)) // frags
		write_short(cs_get_user_deaths(iAttacker)) // deaths
		write_short(0) // class?
		write_short(fm_cs_get_user_team(iAttacker)) // team
		message_end()
		
		message_begin(MSG_BROADCAST, g_msgScoreInfo)
		write_byte(iVictim) // id
		write_short(pev(iVictim, pev_frags)) // frags
		write_short(cs_get_user_deaths(iVictim)) // deaths
		write_short(0) // class?
		write_short(fm_cs_get_user_team(iVictim)) // team
		message_end()

	}else{
		if(dmg > 0) set_pev(iVictim , pev_health , pev(iVictim,pev_health) - dmg)
		if(dmg <= 0) set_pev(iVictim , pev_health , pev(iVictim,pev_health) + dmg)
	}
}

public remove_values(id)
{
	remove_task(id)
	g_can[id] = 0
}

public ability_zero(id) 
{
	g_can[id] -= 1
	if(!g_can[id]) client_print(id,print_center,"Now you can use ability!")
	if(g_can[id]) set_task(1.0,"ability_zero",id)
}

public Burn( victim )
{
	// Get user origin
	static Origin[ 3 ] ; get_user_origin( victim, Origin )
	
	// If burn time is over or victim are in water
	if( Time[ victim ] <= 0 || get_entity_flags( victim ) & FL_INWATER )
	{	
		// Show Smoke sprite	
		message_begin( MSG_PVS, SVC_TEMPENTITY, Origin )
		write_byte( TE_SMOKE ) // TE id
		write_coord( Origin[0] ) // x
		write_coord( Origin[1] ) // y
		write_coord( Origin[2]-50 ) // z
		write_short( sprSmoke ) // sprite
		write_byte( random_num(15, 20) ) // scale
		write_byte( random_num(10, 20) ) // framerate
		message_end( )
		
		// Delay to allow burn again
		set_task( float(get_pcvar_num(cvar_burntime)), "Stop", victim )
		
		// Exit
		return
	}
	else
	{		
		// Flame sprite	
		message_begin( MSG_PVS, SVC_TEMPENTITY, Origin )
		write_byte( TE_SPRITE ) // TE id
		write_coord( Origin[0]+random_num(-5, 5) ) // x
		write_coord( Origin[1]+random_num(-5, 5) ) // y
		write_coord( Origin[2]+random_num(-10, 10) ) // z
		write_short( sprFlame ) // sprite
		write_byte( random_num(5, 10) ) // scale
		write_byte( 200 ) // brightness
		message_end( )
			
		// Decrease Time
		Time[ victim ]--
		
		// Decrease life (random)
		if(get_user_health(victim) -  get_pcvar_num(cvar_burndmg) > 0) set_user_health( victim, get_user_health( victim ) -  get_pcvar_num(cvar_burndmg))
		
		// Stop fire if health <= min health.
		if( get_user_health( victim ) <=  get_pcvar_num(cvar_burndmg))
		{
			g_AlreadyBurn[ victim ] = false
			return
		}
		
		// Repeat
		set_task( 0.5, "Burn", victim )
	}
}

public Stop( victim )
	g_AlreadyBurn[ victim ] = false // Allow burn again

public zp_user_humanized_post(id) remove_values(id)
public fw_PlayerKilled(id, attacker, shouldgib) remove_values(id)
public client_connect(id)  remove_values(id)
public zp_round_ended() g_roundend = 1

public zp_user_infected_post(id)	
{
	Time[ id ] = 0 
	g_AlreadyBurn[ id ] = false
	remove_task(id)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
	set_pev(Player, pev_weaponanim, Sequence)
	
	message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
	write_byte(Sequence)
	write_byte(pev(Player, pev_body))
	message_end()
}

stock UTIL_PlayPlayerAnimation(const id, const Sequence , Float:frame = 1.0 , Float:framerate = 1.0)
{
	entity_set_int(id, EV_INT_sequence, Sequence)
	entity_set_int(id, EV_INT_gaitsequence, 1)
	entity_set_float(id, EV_FL_frame, frame)
	entity_set_float(id, EV_FL_framerate, framerate)
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
	new_velocity[0] = origin2[0] - origin1[0]
	new_velocity[1] = origin2[1] - origin1[1]
	new_velocity[2] = origin2[2] - origin1[2]
	new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
	new_velocity[0] *= num
	new_velocity[1] *= num
	new_velocity[2] *= num
       
	return 1;
} 

stock fm_cs_set_user_deaths(id, value)
{
	set_pdata_int(id, 444, value, 5)
}

stock fm_cs_get_user_team(id)
{
	return get_pdata_int(id, 114, 5);
}
only vip can use , thanks

Last edited by chasper; 07-29-2013 at 07:32.
chasper is offline
CSOfan
BANNED
Join Date: Jul 2013
Old 07-29-2013 , 10:34   Re: add vip class
Reply With Quote #2

PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [ZP] Dragon Zombie -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This plugin add new class zombie: Dragon Zombie.
    
================================================================================*/

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <cstrike>
#include <fun>
#include <xs>
#include <zmvip> 

new const ball_name[] = "dragon_ball";
new const 
ball_model[] = "models/w_hiddentail.mdl";
new const 
ball_firespritemdl[] = "sprites/flame2.spr";
new const 
ball_spriteexplodemdl[] = "sprites/zerogxplode.spr"

new const zclass_name[] = { "Dragon Zombie" // name
new const zclass_info[] = { "Can throw fire balls." // description
new const zclass_model[] = { "zombie_source1" // model
new const zclass_clawmodel[] = { "v_knife_spider.mdl" // claw model
const zclass_health 2000 // health
const zclass_speed 290 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback

new sprFlamesprSmoke

new g_zclassdragon
new cvar_dragondmg cvar_dragondelay cvar_dragonvelocity  cvar_dragonballhealth cvar_dragonballradius cvar_dragonballpower cvar_burndmg cvar_burntime cvar_burn
new g_msgScreenShake g_smoke sTrail ball_firesprite ball_spriteexplode g_explode[512] , g_can[33] , g_msgScoreInfo g_roundend bool:g_AlreadyBurn33 ] , Time33 ]

public 
zp_user_infected_pre(id) { 
    if(
zv_get_user_flags(id) == 0) { 
        if(
zp_get_user_next_class(id) == g_zclass_crow) { 
            
zp_set_user_zombie_class(id0
            
client_print(idprint_center"Your selected class in only for *VIP* members"
            
client_print(idprint_chat"Your selected class in only for *VIP* members. Changed to default zombie class."
        } 
    } 
}  
public 
plugin_init()
{
    
register_plugin("[ZP] Zombie Class: Dragon Zombie""0.1""=)")

    
cvar_dragondelay register_cvar("zp_classdragon_delay","15")
    
cvar_dragondmg register_cvar("zp_classdragonball_dmg","70.0")
    
cvar_dragonvelocity register_cvar("zp_classdragonball_velocity","600")
    
cvar_dragonballhealth register_cvar("zp_classdragonball_health","6")
    
cvar_dragonballradius register_cvar("zp_classdragonball_radius","300.0")
    
cvar_dragonballpower register_cvar "zp_classdragonball_power""800" )
    
cvar_burn register_cvar "zp_classdragonball_enable""1" )
    
cvar_burntime register_cvar "zp_classdragonball_burntime""15" )
    
cvar_burndmg register_cvar "zp_classdragonball_burndmg""3" )

    
register_touch(ball_name"worldspawn",            "touchWorld")
    
register_touch(ball_name"func_wall",            "touchWorld")
    
register_touch(ball_name"func_door",            "touchWorld")
    
register_touch(ball_name"func_door_rotating""touchWorld")
    
register_touch(ball_name"func_wall_toggle",    "touchWorld")
    
register_touch(ball_name"func_breakable",        "touchWorld")
    
register_think(ball_name,"ball_think")

    
register_clcmd("drop","dragon_cmd")
    
register_event("HLTV""event_round_start""a""1=0""2=0")

    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")

    
g_msgScoreInfo get_user_msgid("ScoreInfo")
    
g_msgScreenShake get_user_msgid("ScreenShake")

}

public 
plugin_precache()
{
    
precache_model(ball_model)
    
g_smoke precache_model"sprites/steam1.spr" );
    
sTrail precache_model("sprites/laserbeam.spr")
    
ball_firesprite precache_model(ball_firespritemdl)
    
ball_spriteexplode  precache_model(ball_spriteexplodemdl)

    
sprFlame precache_model"sprites/flame.spr" )
    
sprSmoke precache_model"sprites/black_smoke3.spr" )

    
g_zclassdragon zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    
}
public 
dragon_cmdid )
{
    if( !
is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclassdragon || zp_get_user_nemesis(id))
        return 
PLUGIN_CONTINUE;

    if(
g_can[id]) 
    {
        
client_print(id,print_center,"You cannot use ability now. Wait %d sec.",g_can[id])
        return 
PLUGIN_HANDLED;
    }

    static 
Float:origin[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3];
    static 
Float:OriginX[3]
    
pev(idpev_v_angleangles);
    
pev(idpev_originOriginX);
    
engfunc(EngFunc_MakeVectorsangles);

    
global_get(glb_v_forwardv_forward);
    
global_get(glb_v_rightv_right);
    
global_get(glb_v_upv_up);

    
//m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
    
pev(idpev_originplayer_origin);
    
pev(idpev_view_ofsplayer_view_offset);
    
xs_vec_add(player_originplayer_view_offsetgun_position);

    
xs_vec_mul_scalar(v_forward13.0v_forward);
    
xs_vec_mul_scalar(v_right0.0v_right);
    
xs_vec_mul_scalar(v_up5.0v_up);

    
xs_vec_add(gun_positionv_forwardorigin);
    
xs_vec_add(originv_rightorigin);
    
xs_vec_add(originv_uporigin);

    new 
Float:StartOrigin[3]
            
    
StartOrigin[0] = origin[0];
    
StartOrigin[1] = origin[1];
    
StartOrigin[2] = origin[2];


    new 
Float:fVelocity[3] , Float:flOrigin[3] , Float:flAngle[3]
    
pev(id,pev_origin,flOrigin)
    
pev(id,pev_angles,flAngle)

    new 
ball create_entity("info_target")
    
    if (!
ball) return PLUGIN_HANDLED

    g_explode
[ball] = 0
    
    entity_set_string
(ballEV_SZ_classnameball_name)
    
    
entity_set_model(ballball_model)
    
    
entity_set_origin(ballStartOrigin)
    
    
entity_set_vector(ballEV_VEC_anglesflAngle)
    
    new 
Float:MinBox[3] = {-1.0, -1.0, -1.0}
    new 
Float:MaxBox[3] = {1.01.01.0}
    
entity_set_vector(ballEV_VEC_minsMinBox)
    
entity_set_vector(ballEV_VEC_maxsMaxBox)
    
    
entity_set_int(ballEV_INT_solidSOLID_SLIDEBOX)
    
    
entity_set_int(ballEV_INT_movetypeMOVETYPE_BOUNCE)
    
    
entity_set_edict(ballEV_ENT_ownerid)
    
    
entity_set_int(ballEV_INT_effectsEF_BRIGHTLIGHT)
    
    
VelocityByAim(idget_pcvar_num(cvar_dragonvelocity ), fVelocity)
    
entity_set_vector(ball EV_VEC_velocityfVelocity)
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// Temporary entity ID
    
write_short(ball// Entity
    
write_short(sTrail// Sprite index
    
write_byte(10// Life
    
write_byte(3// Line width
    
write_byte(255// Red
    
write_byte(150// Green
    
write_byte(20// Blue
    
write_byte(255// Alpha
    
message_end() 

    
UTIL_PlayPlayerAnimation(id,10)
    
UTIL_PlayWeaponAnimation(id,8)

    
g_can[id] = get_pcvar_num(cvar_dragondelay)
    
set_task(1.0,"ability_zero",id)

    
entity_set_float(ballEV_FL_health get_pcvar_float(cvar_dragonballhealth))

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1
    
    return 
PLUGIN_HANDLED;
}

public 
touchWorld(ballworld) {

    new 
Float:v[3]
    
entity_get_vector(ballEV_VEC_velocityv)

    
v[0] = (v[0] * 0.85)
    
v[1] = (v[1] * 0.85)
    
v[2] = (v[2] * 0.85)
    
entity_set_vector(ballEV_VEC_velocityv)
    
    return 
PLUGIN_HANDLED
}

public 
event_round_start()
{
    new 
iEnt FM_NULLENT;
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"ball_name)) > )
    {
        
engfunc(EngFunc_RemoveEntity,iEnt)
    }    

    for(new 
i;i<=32;i++)
    {
        
remove_task(i)
        
g_can[i] = 0
        Time
] = 
        g_AlreadyBurn
i] = false
    
}

    
g_roundend 0
}

public 
ball_think(ball)
{
    if(!
is_valid_ent(ball))
        return;

    new 
Float:oldangles[3],Float:angles[3]
    
pev(ball,pev_angles,oldangles)
    
angles[0] = oldangles[0] + random_float(20.0,100.0)
    
angles[1] = oldangles[1] + random_float(10.0,80.0)
    
angles[2] = oldangles[2] + random_float(10.0,80.0)
    
set_pev(ball,pev_angles,angles)

    new 
Float:v[3]
    
entity_get_vector(ballEV_VEC_velocityv)

    if(
v[2] < 40.0 && v[1] < 40.0 && v[0] < 40.0
    {
        if(!
g_explode[ball])
        {
            
set_task(0.5,"firesprite_ball",ball)
            
g_explode[ball] = 1
        
}

        
entity_set_float(ballEV_FL_healthentity_get_float(ball,EV_FL_health) - 0.2

        if(
entity_get_float(ball,EV_FL_health) <= 0.0
        {
            
ball_explode(ball)
            
remove_entity(ball)
            
g_explode[ball] = 0
            
return;
        }
    }

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1

}

public 
firesprite_ball(ball)
{
    if(!
is_valid_ent(ball))
        return;

    new 
Float:flOrigin[3]
    
pev(ball,pev_origin,flOrigin)

    
engfunc EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYflOrigin)
    
write_byte TE_SPRITE )
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] + 45.0 )
    
write_short ball_firesprite )
    
write_byte )
    
write_byte 185 )
    
message_end ( )

    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_SMOKE );
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] + 45.0 )
    
write_shortg_smoke );
    
write_byte10 );
    
write_byte10 );
    
message_end();

    if(
entity_get_float(ball,EV_FL_health) >= 1.0set_task(0.5,"firesprite_ball",ball)
}
public 
ball_explode Entity )
{
    if ( 
Entity )
        return
       
    static 
Float:flOrigin ]
    
pev Entitypev_originflOrigin )
       
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_EXPLOSION// Temporary entity ID
    
engfunc(EngFunc_WriteCoordflOrigin[0]) // engfunc because float
    
engfunc(EngFunc_WriteCoordflOrigin[1])
    
engfunc(EngFunc_WriteCoordflOrigin[2])
    
write_short(ball_spriteexplode// Sprite index
    
write_byte(50// Scale
    
write_byte(15// Framerate
    
write_byte(0// Flags
    
message_end()
    
         new 
iOwner entity_get_edict EntityEV_ENT_owner )
       
          for ( new 
1<= 32 i++ )
    {
        if ( !
is_user_alive  ) || zp_get_user_zombie))
            continue
          
        new 
Float:flVictimOrigin ]
        
pev ipev_originflVictimOrigin )
           
        new 
Float:flDistance get_distance_f flOriginflVictimOrigin )   
           
        if ( 
flDistance <= get_pcvar_float(cvar_dragonballradius) )
        {
            static 
Float:flSpeed
            flSpeed 
get_pcvar_float cvar_dragonballpower )
               
            static 
Float:flNewSpeed
            flNewSpeed 
flSpeed * ( 1.0 - ( flDistance get_pcvar_float(cvar_dragonballradius) ) )
               
            static 
Float:flVelocity ]
            
get_speed_vector flOriginflVictimOriginflNewSpeedflVelocity )
               
            
set_pev ipev_velocity,flVelocity )

            
message_begin(MSG_ONEg_msgScreenShake, {0,0,0}, i)
            
write_short(1<<14// Amount
            
write_short(1<<14// Duration
            
write_short(1<<14// Frequency
            
message_end()

            
radius_damage_abflVictimOriginflOrigin iOwner)

            if(!
g_AlreadyBurn] && get_pcvar_num(cvar_burn ) == 
            {
                
// Burn / ON
                
g_AlreadyBurn] = true
        
                
// Set burn time
                
Time] = get_pcvar_num(cvar_burntime)
        
                
// Burn victim
                
Burn)
            }
        }
    }
}       

public 
radius_damage_ab(Float:originF[3] , Float:flOrigin[3] , iVictim iAttacker)
{
    if(
g_roundend || !is_user_connected(iAttacker) || !is_user_connected(iVictim))
        return;

    new 
Float:dist get_distance_f(originFflOrigin);
    new 
Float:dmg get_pcvar_float(cvar_dragondmg) - ( get_pcvar_float(cvar_dragondmg) / get_pcvar_float(cvar_dragonballradius) ) * dist;

    if(
pev(iVictim,pev_health) - dmg <= 0
    {
        new 
headshot
        
if(dist 20.0headshot 1
        
if(dist >= 20.0headshot 0
        message_begin
MSG_ALLget_user_msgid("DeathMsg"),{0,0,0},0)
        
write_byte(iAttacker)
        
write_byte(iVictim)
        
write_byte(headshot)
        
write_string("dragon")
        
message_end()

        
user_silentkill(iVictim)

        
set_pev(iAttackerpev_fragsfloat(pev(iAttackerpev_frags) + 1))
        
zp_set_user_ammo_packs(iAttackerzp_get_user_ammo_packs(iAttacker) + 1)
        
fm_cs_set_user_deaths(iVictimcs_get_user_deaths(iVictim) + 1)

        
message_begin(MSG_BROADCASTg_msgScoreInfo)
        
write_byte(iAttacker// id
        
write_short(pev(iAttackerpev_frags)) // frags
        
write_short(cs_get_user_deaths(iAttacker)) // deaths
        
write_short(0// class?
        
write_short(fm_cs_get_user_team(iAttacker)) // team
        
message_end()
        
        
message_begin(MSG_BROADCASTg_msgScoreInfo)
        
write_byte(iVictim// id
        
write_short(pev(iVictimpev_frags)) // frags
        
write_short(cs_get_user_deaths(iVictim)) // deaths
        
write_short(0// class?
        
write_short(fm_cs_get_user_team(iVictim)) // team
        
message_end()

    }else{
        if(
dmg 0set_pev(iVictim pev_health pev(iVictim,pev_health) - dmg)
        if(
dmg <= 0set_pev(iVictim pev_health pev(iVictim,pev_health) + dmg)
    }
}

public 
remove_values(id)
{
    
remove_task(id)
    
g_can[id] = 0
}

public 
ability_zero(id
{
    
g_can[id] -= 1
    
if(!g_can[id]) client_print(id,print_center,"Now you can use ability!")
    if(
g_can[id]) set_task(1.0,"ability_zero",id)
}

public 
Burnvictim )
{
    
// Get user origin
    
static Origin] ; get_user_originvictimOrigin )
    
    
// If burn time is over or victim are in water
    
if( Timevictim ] <= || get_entity_flagsvictim ) & FL_INWATER )
    {    
        
// Show Smoke sprite    
        
message_beginMSG_PVSSVC_TEMPENTITYOrigin )
        
write_byteTE_SMOKE // TE id
        
write_coordOrigin[0] ) // x
        
write_coordOrigin[1] ) // y
        
write_coordOrigin[2]-50 // z
        
write_shortsprSmoke // sprite
        
write_byterandom_num(1520) ) // scale
        
write_byterandom_num(1020) ) // framerate
        
message_end( )
        
        
// Delay to allow burn again
        
set_taskfloat(get_pcvar_num(cvar_burntime)), "Stop"victim )
        
        
// Exit
        
return
    }
    else
    {        
        
// Flame sprite    
        
message_beginMSG_PVSSVC_TEMPENTITYOrigin )
        
write_byteTE_SPRITE // TE id
        
write_coordOrigin[0]+random_num(-55) ) // x
        
write_coordOrigin[1]+random_num(-55) ) // y
        
write_coordOrigin[2]+random_num(-1010) ) // z
        
write_shortsprFlame // sprite
        
write_byterandom_num(510) ) // scale
        
write_byte200 // brightness
        
message_end( )
            
        
// Decrease Time
        
Timevictim ]--
        
        
// Decrease life (random)
        
if(get_user_health(victim) -  get_pcvar_num(cvar_burndmg) > 0set_user_healthvictimget_user_healthvictim ) -  get_pcvar_num(cvar_burndmg))
        
        
// Stop fire if health <= min health.
        
if( get_user_healthvictim ) <=  get_pcvar_num(cvar_burndmg))
        {
            
g_AlreadyBurnvictim ] = false
            
return
        }
        
        
// Repeat
        
set_task0.5"Burn"victim )
    }
}

public 
Stopvictim )
    
g_AlreadyBurnvictim ] = false // Allow burn again

public zp_user_humanized_post(idremove_values(id)
public 
fw_PlayerKilled(idattackershouldgibremove_values(id)
public 
client_connect(id)  remove_values(id)
public 
zp_round_ended() g_roundend 1

public zp_user_infected_post(id)    
{
    
Timeid ] = 
    g_AlreadyBurn
id ] = false
    remove_task
(id)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

stock UTIL_PlayPlayerAnimation(const id, const Sequence Float:frame 1.0 Float:framerate 1.0)
{
    
entity_set_int(idEV_INT_sequenceSequence)
    
entity_set_int(idEV_INT_gaitsequence1)
    
entity_set_float(idEV_FL_frameframe)
    
entity_set_float(idEV_FL_framerateframerate)
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speedFloat:new_velocity[3])
{
    
new_velocity[0] = origin2[0] - origin1[0]
    
new_velocity[1] = origin2[1] - origin1[1]
    
new_velocity[2] = origin2[2] - origin1[2]
    new 
Float:num floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
    
new_velocity[0] *= num
    new_velocity
[1] *= num
    new_velocity
[2] *= num
       
    
return 1;


stock fm_cs_set_user_deaths(idvalue)
{
    
set_pdata_int(id444value5)
}

stock fm_cs_get_user_team(id)
{
    return 
get_pdata_int(id1145);


Try This
Attached Files
File Type: sma Get Plugin or Get Source (vip_class.sma - 555 views - 15.9 KB)
CSOfan is offline
chasper
Member
Join Date: Dec 2012
Location: Hungary
Old 07-30-2013 , 09:03   Re: add vip class
Reply With Quote #3

vip_class.sma(47) : error 017: undefined symbol "g_zclass_crow"

1 Error.
Compile failed!

chasper is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 07-30-2013 , 10:44   Re: add vip class
Reply With Quote #4

untested:
PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [ZP] Dragon Zombie -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This plugin add new class zombie: Dragon Zombie.
    
================================================================================*/

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <cstrike>
#include <fun>
#include <xs>
#include <zmvip>

new const ball_name[] = "dragon_ball";
new const 
ball_model[] = "models/w_hiddentail.mdl";
new const 
ball_firespritemdl[] = "sprites/flame2.spr";
new const 
ball_spriteexplodemdl[] = "sprites/zerogxplode.spr"

new const zclass_name[] = { "Dragon Zombie" // name
new const zclass_info[] = { "Can throw fire balls." // description
new const zclass_model[] = { "zombie_source1" // model
new const zclass_clawmodel[] = { "v_knife_spider.mdl" // claw model
const zclass_health 2000 // health
const zclass_speed 290 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback

new sprFlamesprSmoke

new g_zclassdragon
new cvar_dragondmg cvar_dragondelay cvar_dragonvelocity  cvar_dragonballhealth cvar_dragonballradius cvar_dragonballpower cvar_burndmg cvar_burntime cvar_burn
new g_msgScreenShake g_smoke sTrail ball_firesprite ball_spriteexplode g_explode[512] , g_can[33] , g_msgScoreInfo g_roundend bool:g_AlreadyBurn33 ] , Time33 ]

public 
plugin_init()
{
    
register_plugin("[ZP] Zombie Class: Dragon Zombie""0.1""=)")

    
cvar_dragondelay register_cvar("zp_classdragon_delay","15")
    
cvar_dragondmg register_cvar("zp_classdragonball_dmg","70.0")
    
cvar_dragonvelocity register_cvar("zp_classdragonball_velocity","600")
    
cvar_dragonballhealth register_cvar("zp_classdragonball_health","6")
    
cvar_dragonballradius register_cvar("zp_classdragonball_radius","300.0")
    
cvar_dragonballpower register_cvar "zp_classdragonball_power""800" )
    
cvar_burn register_cvar "zp_classdragonball_enable""1" )
    
cvar_burntime register_cvar "zp_classdragonball_burntime""15" )
    
cvar_burndmg register_cvar "zp_classdragonball_burndmg""3" )

    
register_touch(ball_name"worldspawn",            "touchWorld")
    
register_touch(ball_name"func_wall",            "touchWorld")
    
register_touch(ball_name"func_door",            "touchWorld")
    
register_touch(ball_name"func_door_rotating""touchWorld")
    
register_touch(ball_name"func_wall_toggle",    "touchWorld")
    
register_touch(ball_name"func_breakable",        "touchWorld")
    
register_think(ball_name,"ball_think")

    
register_clcmd("drop","dragon_cmd")
    
register_event("HLTV""event_round_start""a""1=0""2=0")

    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")

    
g_msgScoreInfo get_user_msgid("ScoreInfo")
    
g_msgScreenShake get_user_msgid("ScreenShake")

}

public 
plugin_precache()
{
    
precache_model(ball_model)
    
g_smoke precache_model"sprites/steam1.spr" );
    
sTrail precache_model("sprites/laserbeam.spr")
    
ball_firesprite precache_model(ball_firespritemdl)
    
ball_spriteexplode  precache_model(ball_spriteexplodemdl)

    
sprFlame precache_model"sprites/flame.spr" )
    
sprSmoke precache_model"sprites/black_smoke3.spr" )

    
g_zclassdragon zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    
}

public 
zp_user_infected_pre(id) {
    if(
zv_get_user_flags(id) == 0) {
        if(
zp_get_user_next_class(id) == g_zclassdragon) {
            
zp_set_user_zombie_class(id0)
            
client_print(idprint_center"Your selected class in only for *VIP* members")
            
client_print(idprint_chat"Your selected class in only for *VIP* members. Changed to default zombie class.")
        }
    }


public 
dragon_cmdid )
{
    if( !
is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclassdragon || zp_get_user_nemesis(id))
        return 
PLUGIN_CONTINUE;

    if(
g_can[id]) 
    {
        
client_print(id,print_center,"You cannot use ability now. Wait %d sec.",g_can[id])
        return 
PLUGIN_HANDLED;
    }

    static 
Float:origin[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3];
    static 
Float:OriginX[3]
    
pev(idpev_v_angleangles);
    
pev(idpev_originOriginX);
    
engfunc(EngFunc_MakeVectorsangles);

    
global_get(glb_v_forwardv_forward);
    
global_get(glb_v_rightv_right);
    
global_get(glb_v_upv_up);

    
//m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
    
pev(idpev_originplayer_origin);
    
pev(idpev_view_ofsplayer_view_offset);
    
xs_vec_add(player_originplayer_view_offsetgun_position);

    
xs_vec_mul_scalar(v_forward13.0v_forward);
    
xs_vec_mul_scalar(v_right0.0v_right);
    
xs_vec_mul_scalar(v_up5.0v_up);

    
xs_vec_add(gun_positionv_forwardorigin);
    
xs_vec_add(originv_rightorigin);
    
xs_vec_add(originv_uporigin);

    new 
Float:StartOrigin[3]
            
    
StartOrigin[0] = origin[0];
    
StartOrigin[1] = origin[1];
    
StartOrigin[2] = origin[2];


    new 
Float:fVelocity[3] , Float:flOrigin[3] , Float:flAngle[3]
    
pev(id,pev_origin,flOrigin)
    
pev(id,pev_angles,flAngle)

    new 
ball create_entity("info_target")
    
    if (!
ball) return PLUGIN_HANDLED

    g_explode
[ball] = 0
    
    entity_set_string
(ballEV_SZ_classnameball_name)
    
    
entity_set_model(ballball_model)
    
    
entity_set_origin(ballStartOrigin)
    
    
entity_set_vector(ballEV_VEC_anglesflAngle)
    
    new 
Float:MinBox[3] = {-1.0, -1.0, -1.0}
    new 
Float:MaxBox[3] = {1.01.01.0}
    
entity_set_vector(ballEV_VEC_minsMinBox)
    
entity_set_vector(ballEV_VEC_maxsMaxBox)
    
    
entity_set_int(ballEV_INT_solidSOLID_SLIDEBOX)
    
    
entity_set_int(ballEV_INT_movetypeMOVETYPE_BOUNCE)
    
    
entity_set_edict(ballEV_ENT_ownerid)
    
    
entity_set_int(ballEV_INT_effectsEF_BRIGHTLIGHT)
    
    
VelocityByAim(idget_pcvar_num(cvar_dragonvelocity ), fVelocity)
    
entity_set_vector(ball EV_VEC_velocityfVelocity)
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// Temporary entity ID
    
write_short(ball// Entity
    
write_short(sTrail// Sprite index
    
write_byte(10// Life
    
write_byte(3// Line width
    
write_byte(255// Red
    
write_byte(150// Green
    
write_byte(20// Blue
    
write_byte(255// Alpha
    
message_end() 

    
UTIL_PlayPlayerAnimation(id,10)
    
UTIL_PlayWeaponAnimation(id,8)

    
g_can[id] = get_pcvar_num(cvar_dragondelay)
    
set_task(1.0,"ability_zero",id)

    
entity_set_float(ballEV_FL_health get_pcvar_float(cvar_dragonballhealth))

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1
    
    return 
PLUGIN_HANDLED;
}

public 
touchWorld(ballworld) {

    new 
Float:v[3]
    
entity_get_vector(ballEV_VEC_velocityv)

    
v[0] = (v[0] * 0.85)
    
v[1] = (v[1] * 0.85)
    
v[2] = (v[2] * 0.85)
    
entity_set_vector(ballEV_VEC_velocityv)
    
    return 
PLUGIN_HANDLED
}

public 
event_round_start()
{
    new 
iEnt FM_NULLENT;
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"ball_name)) > )
    {
        
engfunc(EngFunc_RemoveEntity,iEnt)
    }    

    for(new 
i;i<=32;i++)
    {
        
remove_task(i)
        
g_can[i] = 0
        Time
] = 
        g_AlreadyBurn
i] = false
    
}

    
g_roundend 0
}

public 
ball_think(ball)
{
    if(!
is_valid_ent(ball))
        return;

    new 
Float:oldangles[3],Float:angles[3]
    
pev(ball,pev_angles,oldangles)
    
angles[0] = oldangles[0] + random_float(20.0,100.0)
    
angles[1] = oldangles[1] + random_float(10.0,80.0)
    
angles[2] = oldangles[2] + random_float(10.0,80.0)
    
set_pev(ball,pev_angles,angles)

    new 
Float:v[3]
    
entity_get_vector(ballEV_VEC_velocityv)

    if(
v[2] < 40.0 && v[1] < 40.0 && v[0] < 40.0
    {
        if(!
g_explode[ball])
        {
            
set_task(0.5,"firesprite_ball",ball)
            
g_explode[ball] = 1
        
}

        
entity_set_float(ballEV_FL_healthentity_get_float(ball,EV_FL_health) - 0.2

        if(
entity_get_float(ball,EV_FL_health) <= 0.0
        {
            
ball_explode(ball)
            
remove_entity(ball)
            
g_explode[ball] = 0
            
return;
        }
    }

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1

}

public 
firesprite_ball(ball)
{
    if(!
is_valid_ent(ball))
        return;

    new 
Float:flOrigin[3]
    
pev(ball,pev_origin,flOrigin)

    
engfunc EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYflOrigin)
    
write_byte TE_SPRITE )
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] + 45.0 )
    
write_short ball_firesprite )
    
write_byte )
    
write_byte 185 )
    
message_end ( )

    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_SMOKE );
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] )
    
engfunc EngFunc_WriteCoordflOrigin ] + 45.0 )
    
write_shortg_smoke );
    
write_byte10 );
    
write_byte10 );
    
message_end();

    if(
entity_get_float(ball,EV_FL_health) >= 1.0set_task(0.5,"firesprite_ball",ball)
}
public 
ball_explode Entity )
{
    if ( 
Entity )
        return
       
    static 
Float:flOrigin ]
    
pev Entitypev_originflOrigin )
       
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_EXPLOSION// Temporary entity ID
    
engfunc(EngFunc_WriteCoordflOrigin[0]) // engfunc because float
    
engfunc(EngFunc_WriteCoordflOrigin[1])
    
engfunc(EngFunc_WriteCoordflOrigin[2])
    
write_short(ball_spriteexplode// Sprite index
    
write_byte(50// Scale
    
write_byte(15// Framerate
    
write_byte(0// Flags
    
message_end()
    
         new 
iOwner entity_get_edict EntityEV_ENT_owner )
       
          for ( new 
1<= 32 i++ )
    {
        if ( !
is_user_alive  ) || zp_get_user_zombie))
            continue
          
        new 
Float:flVictimOrigin ]
        
pev ipev_originflVictimOrigin )
           
        new 
Float:flDistance get_distance_f flOriginflVictimOrigin )   
           
        if ( 
flDistance <= get_pcvar_float(cvar_dragonballradius) )
        {
            static 
Float:flSpeed
            flSpeed 
get_pcvar_float cvar_dragonballpower )
               
            static 
Float:flNewSpeed
            flNewSpeed 
flSpeed * ( 1.0 - ( flDistance get_pcvar_float(cvar_dragonballradius) ) )
               
            static 
Float:flVelocity ]
            
get_speed_vector flOriginflVictimOriginflNewSpeedflVelocity )
               
            
set_pev ipev_velocity,flVelocity )

            
message_begin(MSG_ONEg_msgScreenShake, {0,0,0}, i)
            
write_short(1<<14// Amount
            
write_short(1<<14// Duration
            
write_short(1<<14// Frequency
            
message_end()

            
radius_damage_abflVictimOriginflOrigin iOwner)

            if(!
g_AlreadyBurn] && get_pcvar_num(cvar_burn ) == 
            {
                
// Burn / ON
                
g_AlreadyBurn] = true
        
                
// Set burn time
                
Time] = get_pcvar_num(cvar_burntime)
        
                
// Burn victim
                
Burn)
            }
        }
    }
}       

public 
radius_damage_ab(Float:originF[3] , Float:flOrigin[3] , iVictim iAttacker)
{
    if(
g_roundend || !is_user_connected(iAttacker) || !is_user_connected(iVictim))
        return;

    new 
Float:dist get_distance_f(originFflOrigin);
    new 
Float:dmg get_pcvar_float(cvar_dragondmg) - ( get_pcvar_float(cvar_dragondmg) / get_pcvar_float(cvar_dragonballradius) ) * dist;

    if(
pev(iVictim,pev_health) - dmg <= 0
    {
        new 
headshot
        
if(dist 20.0headshot 1
        
if(dist >= 20.0headshot 0
        message_begin
MSG_ALLget_user_msgid("DeathMsg"),{0,0,0},0)
        
write_byte(iAttacker)
        
write_byte(iVictim)
        
write_byte(headshot)
        
write_string("dragon")
        
message_end()

        
user_silentkill(iVictim)

        
set_pev(iAttackerpev_fragsfloat(pev(iAttackerpev_frags) + 1))
        
zp_set_user_ammo_packs(iAttackerzp_get_user_ammo_packs(iAttacker) + 1)
        
fm_cs_set_user_deaths(iVictimcs_get_user_deaths(iVictim) + 1)

        
message_begin(MSG_BROADCASTg_msgScoreInfo)
        
write_byte(iAttacker// id
        
write_short(pev(iAttackerpev_frags)) // frags
        
write_short(cs_get_user_deaths(iAttacker)) // deaths
        
write_short(0// class?
        
write_short(fm_cs_get_user_team(iAttacker)) // team
        
message_end()
        
        
message_begin(MSG_BROADCASTg_msgScoreInfo)
        
write_byte(iVictim// id
        
write_short(pev(iVictimpev_frags)) // frags
        
write_short(cs_get_user_deaths(iVictim)) // deaths
        
write_short(0// class?
        
write_short(fm_cs_get_user_team(iVictim)) // team
        
message_end()

    }else{
        if(
dmg 0set_pev(iVictim pev_health pev(iVictim,pev_health) - dmg)
        if(
dmg <= 0set_pev(iVictim pev_health pev(iVictim,pev_health) + dmg)
    }
}

public 
remove_values(id)
{
    
remove_task(id)
    
g_can[id] = 0
}

public 
ability_zero(id
{
    
g_can[id] -= 1
    
if(!g_can[id]) client_print(id,print_center,"Now you can use ability!")
    if(
g_can[id]) set_task(1.0,"ability_zero",id)
}

public 
Burnvictim )
{
    
// Get user origin
    
static Origin] ; get_user_originvictimOrigin )
    
    
// If burn time is over or victim are in water
    
if( Timevictim ] <= || get_entity_flagsvictim ) & FL_INWATER )
    {    
        
// Show Smoke sprite    
        
message_beginMSG_PVSSVC_TEMPENTITYOrigin )
        
write_byteTE_SMOKE // TE id
        
write_coordOrigin[0] ) // x
        
write_coordOrigin[1] ) // y
        
write_coordOrigin[2]-50 // z
        
write_shortsprSmoke // sprite
        
write_byterandom_num(1520) ) // scale
        
write_byterandom_num(1020) ) // framerate
        
message_end( )
        
        
// Delay to allow burn again
        
set_taskfloat(get_pcvar_num(cvar_burntime)), "Stop"victim )
        
        
// Exit
        
return
    }
    else
    {        
        
// Flame sprite    
        
message_beginMSG_PVSSVC_TEMPENTITYOrigin )
        
write_byteTE_SPRITE // TE id
        
write_coordOrigin[0]+random_num(-55) ) // x
        
write_coordOrigin[1]+random_num(-55) ) // y
        
write_coordOrigin[2]+random_num(-1010) ) // z
        
write_shortsprFlame // sprite
        
write_byterandom_num(510) ) // scale
        
write_byte200 // brightness
        
message_end( )
            
        
// Decrease Time
        
Timevictim ]--
        
        
// Decrease life (random)
        
if(get_user_health(victim) -  get_pcvar_num(cvar_burndmg) > 0set_user_healthvictimget_user_healthvictim ) -  get_pcvar_num(cvar_burndmg))
        
        
// Stop fire if health <= min health.
        
if( get_user_healthvictim ) <=  get_pcvar_num(cvar_burndmg))
        {
            
g_AlreadyBurnvictim ] = false
            
return
        }
        
        
// Repeat
        
set_task0.5"Burn"victim )
    }
}

public 
Stopvictim )
    
g_AlreadyBurnvictim ] = false // Allow burn again

public zp_user_humanized_post(idremove_values(id)
public 
fw_PlayerKilled(idattackershouldgibremove_values(id)
public 
client_connect(id)  remove_values(id)
public 
zp_round_ended() g_roundend 1

public zp_user_infected_post(id)    
{
    
Timeid ] = 
    g_AlreadyBurn
id ] = false
    remove_task
(id)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player)
    
write_byte(Sequence)
    
write_byte(pev(Playerpev_body))
    
message_end()
}

stock UTIL_PlayPlayerAnimation(const id, const Sequence Float:frame 1.0 Float:framerate 1.0)
{
    
entity_set_int(idEV_INT_sequenceSequence)
    
entity_set_int(idEV_INT_gaitsequence1)
    
entity_set_float(idEV_FL_frameframe)
    
entity_set_float(idEV_FL_framerateframerate)
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speedFloat:new_velocity[3])
{
    
new_velocity[0] = origin2[0] - origin1[0]
    
new_velocity[1] = origin2[1] - origin1[1]
    
new_velocity[2] = origin2[2] - origin1[2]
    new 
Float:num floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
    
new_velocity[0] *= num
    new_velocity
[1] *= num
    new_velocity
[2] *= num
       
    
return 1;


stock fm_cs_set_user_deaths(idvalue)
{
    
set_pdata_int(id444value5)
}

stock fm_cs_get_user_team(id)
{
    return 
get_pdata_int(id1145);


Last edited by JusTGo; 07-30-2013 at 10:54.
JusTGo 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 12:04.


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