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

Help / Support Zombie CSO theme problem


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-17-2014 , 16:36   Re: Zombie CSO theme problem
Reply With Quote #11

Maybe the problem happen due to this:
PHP Code:
new zp_cso_respawnsprite[][] = 
{
    
"sprites/zombie_plague/cso/zp_zbrespawn.spr"
}

/*---------------------------------------------*
 [ ZP CSO Plugin Human Level Up Sprite ]
*---------------------------------------------*/

new zp_cso_levelsprite[][] = 
{
    
"sprites/zombie_plague/cso/zp_hmlvlup.spr"

So do you have both models?
Quote:
1. zp_zbrespawn.spr
2. zp_hmlvlup.spr

Last edited by zmd94; 08-17-2014 at 16:36.
zmd94 is offline
Rx3toofan
Member
Join Date: Jul 2014
Old 08-18-2014 , 08:29   Re: Zombie CSO theme problem
Reply With Quote #12

00

Last edited by Rx3toofan; 08-18-2014 at 17:22.
Rx3toofan is offline
Rx3toofan
Member
Join Date: Jul 2014
Old 08-18-2014 , 17:20   Re: Zombie CSO theme problem
Reply With Quote #13

L 08/18/2014 - 20:21:59: Start of error session.
L 08/18/2014 - 20:21:59: Info (map "zm_infantry_cbf_v2") (file "addons/amxmodx/logs/error_20140818.log")
L 08/18/2014 - 20:21:59: [ZP] Invalid Player (1)
L 08/18/2014 - 20:21:59: [AMXX] Displaying debug trace (plugin "zp_zclass_deimos.amxx")
L 08/18/2014 - 20:21:59: [AMXX] Run time error 10: native error (native "zp_get_user_zombie")
L 08/18/2014 - 20:21:59: [AMXX] [0] zp_zclass_deimos.sma::reset_cooldown (line 153)


i got this error here is the sma

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

// Zombie Attributes
new const zclass_name[] = "Deimos Zombie" // name
new const zclass_info[] = "| G -> Drop Human Weapon" // description
new const zclass_model[] = "deimos_zombi_origin" // model
new const zclass_clawmodel[] = "v_knife_deimos_zombi.mdl" // claw model
const zclass_health 2000 // health
const zclass_speed 280 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback

new g_zclass_deimos
new bool:can_use_skill[33]

new 
trail_spr
new exp_spr

const m_flTimeWeaponIdle 48
const m_flNextAttack 83

new const light_classname[] = "deimos_skill"
new const skill_start[] = "zombie_plague/deimos_skill_start.wav"
new const skill_hit[] = "zombie_plague/deimos_skill_hit.wav"

#define TASK_WAIT 11111
#define TASK_ATTACK 22222
#define TASK_COOLDOWN 33333

const WPN_NOT_DROP = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new 
cvar_cooldown


public plugin_init()
{
    
register_plugin("[ZP] Zombie Class: Deimos""1.0""Dias")
    
    
cvar_cooldown register_cvar("zp_deimos_cooldown""30")
    
    
register_forward(FM_Touch"fw_Touch")
    
register_clcmd("drop""use_skill")
}

public 
plugin_precache()
{
    
trail_spr precache_model("sprites/zb3/trail.spr")
    
exp_spr precache_model("sprites/zb3/deimosexp.spr")
    
    
precache_sound(skill_start)
    
precache_sound(skill_hit)
    
    
g_zclass_deimos zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    
}

public 
zp_user_infected_post(idinfector)
{
    if (
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos)
    {
        
can_use_skill[id] = true
        client_print
(idprint_chat"[ZP] You are Deimos Zombie, Aim and Press (G) to Drop Human Weapon")
    }
}

public 
use_skill(id)
{
    if (
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos && !zp_get_user_nemesis(id))
    {
        if(
can_use_skill[id])
        {
            
do_skill(id)
            
can_use_skill[id] = false
        
} else {
            
client_print(idprint_chat"[ZP] You can't use your skill now...")
        }
    }
}

public 
do_skill(id)
{
    
play_weapon_anim(id8)
    
set_weapons_timeidle(id7.0)
    
set_player_nextattack(id0.5)
    
PlayEmitSound(idskill_start)
    
entity_set_int(idEV_INT_sequence10)

    
set_task(0.5"launch_light"id+TASK_ATTACK)
}

public 
launch_light(taskid)
{
    new 
id taskid TASK_ATTACK
    
if (task_exists(id+TASK_ATTACK)) remove_task(id+TASK_ATTACK)
    
    if (!
is_user_alive(id)) return;
    
    
// check
    
new FloatfOrigin[3], Float:fAngle[3],FloatfVelocity[3]
    
pev(idpev_originfOrigin)
    
pev(idpev_view_ofsfAngle)
    
fm_velocity_by_aim(id2.0fVelocityfAngle)
    
fAngle[0] *= -1.0
    
    
// create ent
    
new ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    
set_pev(entpev_classnamelight_classname)
    
engfunc(EngFunc_SetModelent"models/w_hegrenade.mdl")
    
set_pev(entpev_minsFloat:{-1.0, -1.0, -1.0})
    
set_pev(entpev_maxsFloat:{1.01.01.0})
    
set_pev(entpev_originfOrigin)
    
fOrigin[0] += fVelocity[0]
    
fOrigin[1] += fVelocity[1]
    
fOrigin[2] += fVelocity[2]
    
set_pev(entpev_movetypeMOVETYPE_BOUNCE)
    
set_pev(entpev_gravity0.01)
    
fVelocity[0] *= 1000
    fVelocity
[1] *= 1000
    fVelocity
[2] *= 1000
    set_pev
(entpev_velocityfVelocity)
    
set_pev(entpev_ownerid)
    
set_pev(entpev_anglesfAngle)
    
set_pev(entpev_solidSOLID_BBOX)                        //store the enitty id
    
    // invisible ent
    
fm_set_rendering(entkRenderFxGlowShell000kRenderTransAlpha0)
    
    
// show trail    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byte(TE_BEAMFOLLOW)
    
write_short(ent)                //entity
    
write_short(trail_spr)        //model
    
write_byte(5)        //10)//life
    
write_byte(3)        //5)//width
    
write_byte(209)                    //r, hegrenade
    
write_byte(120)                    //g, gas-grenade
    
write_byte(9)                    //b
    
write_byte(200)        //brightness
    
message_end()                    //move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS)
    
    
client_print(idprint_chat"[ZP] You have to wait %i seconds to continue use skill !!!"get_pcvar_num(cvar_cooldown))
    
set_task(get_pcvar_float(cvar_cooldown), "reset_cooldown"id+TASK_COOLDOWN)
    
    return;
}

public 
reset_cooldown(taskid)
{
    new 
id taskid TASK_COOLDOWN
    
    
if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos && !zp_get_user_nemesis(id))
    {
        
can_use_skill[id] = true
        client_print
(idprint_chat"[ZP] Now. You can use your skill. Aim and Press (G)")
    }
}

public 
fw_Touch(entvictim)
{
    if (!
pev_valid(ent)) return FMRES_IGNORED
    
    
new EntClassName[32]
    
entity_get_string(entEV_SZ_classnameEntClassNamecharsmax(EntClassName))
    
    if (
equal(EntClassNamelight_classname)) 
    {
        
light_exp(entvictim)
        
remove_entity(ent)
        return 
FMRES_IGNORED
    
}
    
    return 
FMRES_IGNORED
}

light_exp(entvictim)
{
    if (!
pev_valid(ent)) return;
    
    if (
is_user_alive(victim) && !zp_get_user_zombie(victim) && !zp_get_user_survivor(victim))
    {
        new 
wpnwpnname[32]
        
wpn get_user_weapon(victim)
        if( !(
WPN_NOT_DROP & (1<<wpn)) && get_weaponname(wpnwpnnamecharsmax(wpnname)) )
        {
            
engclient_cmd(victim"drop"wpnname)
        }
    }
    
    
// create effect
    
static Float:origin[3];
    
pev(entpev_originorigin);
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); 
    
write_byte(TE_EXPLOSION); // TE_EXPLOSION
    
write_coord(floatround(origin[0])); // origin x
    
write_coord(floatround(origin[1])); // origin y
    
write_coord(floatround(origin[2])); // origin z
    
write_short(exp_spr); // sprites
    
write_byte(40); // scale in 0.1's
    
write_byte(30); // framerate
    
write_byte(14); // flags 
    
message_end(); // message end
    
    // play sound exp
    
PlayEmitSound(entskill_hit)
}

PlayEmitSound(id, const sound[])
{
    
emit_sound(idCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
}

play_weapon_anim(playeranim)
{
    
set_pev(playerpev_weaponanimanim)
    
message_begin(MSG_ONESVC_WEAPONANIM, {000}, player)
    
write_byte(anim)
    
write_byte(pev(playerpev_body))
    
message_end()
}

fm_velocity_by_aim(iIndexFloat:fDistanceFloat:fVelocity[3], Float:fViewAngle[3])
{
    
//new Float:fViewAngle[3]
    
pev(iIndexpev_v_anglefViewAngle)
    
fVelocity[0] = floatcos(fViewAngle[1], degrees) * fDistance
    fVelocity
[1] = floatsin(fViewAngle[1], degrees) * fDistance
    fVelocity
[2] = floatcos(fViewAngle[0]+90.0degrees) * fDistance
    
return 1
}

get_weapon_ent(idweaponid)
{
    static 
wname[32], weapon_ent
    get_weaponname
(weaponidwnamecharsmax(wname))
    
weapon_ent fm_find_ent_by_owner(-1wnameid)
    return 
weapon_ent
}

set_weapons_timeidle(idFloat:timeidle)
{
    new 
entwpn get_weapon_ent(idget_user_weapon(id))
    if (
pev_valid(entwpn)) set_pdata_float(entwpnm_flTimeWeaponIdletimeidle+3.04)
}

set_player_nextattack(idFloat:nexttime)
{
    
set_pdata_float(idm_flNextAttacknexttime4)
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) { /* keep looping */ }
    return 
entity;
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:color[3]
    
color[0] = float(r)
    
color[1] = float(g)
    
color[2] = float(b)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))

Rx3toofan is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-18-2014 , 19:53   Re: Zombie CSO theme problem
Reply With Quote #14

Just change this:
PHP Code:
public reset_cooldown(taskid)
{
    new 
id taskid TASK_COOLDOWN
    
    
if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos && !zp_get_user_nemesis(id))
    {
        
can_use_skill[id] = true
        client_print
(idprint_chat"[ZP] Now. You can use your skill. Aim and Press (G)")
    }

--->
PHP Code:
public reset_cooldown(taskid)
{
    new 
id taskid TASK_COOLDOWN
    
     
if (is_user_alive (id) && zp_get_user_zombie(id) &&  zp_get_user_zombie_class(id) == g_zclass_deimos &&  !zp_get_user_nemesis(id))
    {
        
can_use_skill[id] = true
        client_print
(idprint_chat"[ZP] Now. You can use your skill. Aim and Press (G)")
    }

zmd94 is offline
Rx3toofan
Member
Join Date: Jul 2014
Old 08-19-2014 , 06:25   Re: Zombie CSO theme problem
Reply With Quote #15

Quote:
Originally Posted by zmd94 View Post
Just change this:
PHP Code:
public reset_cooldown(taskid)
{
    new 
id taskid TASK_COOLDOWN
    
    
if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos && !zp_get_user_nemesis(id))
    {
        
can_use_skill[id] = true
        client_print
(idprint_chat"[ZP] Now. You can use your skill. Aim and Press (G)")
    }

--->
PHP Code:
public reset_cooldown(taskid)
{
    new 
id taskid TASK_COOLDOWN
    
     
if (is_user_alive (id) && zp_get_user_zombie(id) &&  zp_get_user_zombie_class(id) == g_zclass_deimos &&  !zp_get_user_nemesis(id))
    {
        
can_use_skill[id] = true
        client_print
(idprint_chat"[ZP] Now. You can use your skill. Aim and Press (G)")
    }

Ty Work

btw is there a admin chat only for admin i have search but i didnot found like . Hello for all admins online not for players without conosle
Rx3toofan is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-19-2014 , 06:36   Re: Zombie CSO theme problem
Reply With Quote #16

Just try to search "admin chat". ;)

Last edited by zmd94; 08-19-2014 at 06:36.
zmd94 is offline
Rx3toofan
Member
Join Date: Jul 2014
Old 08-19-2014 , 14:08   Re: Zombie CSO theme problem
Reply With Quote #17

Quote:
Originally Posted by zmd94 View Post
Just try to search "admin chat". ;)


Ty ok i got a knife problem

if i download knife menu i got more than 512 perache so server wont open

i ask if there is way to give all players 1 knife + admins with model and nice look

please i try to search wont work

i prefer a claw
Rx3toofan is offline
Rx3toofan
Member
Join Date: Jul 2014
Old 08-19-2014 , 16:32   Re: Zombie CSO theme problem
Reply With Quote #18

ty i have found it here is it if someone needs it

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

#define CUSTOM_MODELS  1
#define MAX_KNIFE_SNDS 9

#if (CUSTOM_MODELS)
    
new MODEL_PLAYER[]     = "models/p_strong1.mdl"
#endif

#define PLUGIN    "Knife Knockback"
#define VERSION    "3.0"
#define AUTHOR    "CHyC / fl0wer"


new cvar_knife cvar_knock cvar_jump cvar_survivor cvar_soundscvar_damage_humancvar_damage_survivor;

new const 
knife_sounds[][] =
{
        
"zombie_plague/strong_draw.wav",
        
"zombie_plague/strong_hit_01.wav",
        
"zombie_plague/strong_hit_02.wav",
        
"zombie_plague/strong_hit_wall.wav",
        
"zombie_plague/strong_miss.wav",
        
"zombie_plague/strong_stab.wav"
}

new const 
oldknife_sounds[][] =
{
    
"weapons/knife_deploy1.wav",
    
"weapons/knife_hit1.wav",
    
"weapons/knife_hit2.wav",
    
"weapons/knife_hit3.wav",
    
"weapons/knife_hit4.wav",
    
"weapons/knife_hitwall1.wav",
    
"weapons/knife_slash1.wav",
    
"weapons/knife_slash2.wav",
    
"weapons/knife_stab.wav"
}

public 
plugin_init()
{
    
register_plugin(PLUGIN VERSION AUTHOR);
    
register_cvar("zp_knife"VERSIONFCVAR_SERVER);
    
register_event("Damage" "event_Damage" "b" "2>0");
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" );
    
register_forward(FM_EmitSound"fw_EmitSound");
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");

    
cvar_knife         register_cvar("zp_knife_knock" "3.2");
    
cvar_knock       register_cvar("zp_knife_power" "10");
    
cvar_jump          register_cvar("zp_knife_jump""400.0");
        
cvar_survivor      register_cvar("zp_knife_survivor" "1");
        
cvar_sounds        register_cvar("zp_knife_sound" "1");
    
cvar_damage_human    register_cvar("zp_knife_damage_survivor""8")
    
cvar_damage_survivor    register_cvar("zp_knife_damage_human""6")
}

public 
event_Damage(id)
{
    if(!
get_pcvar_num(cvar_knife))
        return 
PLUGIN_CONTINUE;

    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE;

    if(
zp_get_user_survivor(id) && get_pcvar_num(cvar_survivor) == 0)
        return 
PLUGIN_CONTINUE;

    new 
weapon attacker get_user_attacker(id weapon);

    if(!
is_user_alive(attacker))
        return 
PLUGIN_CONTINUE;

    if(
weapon == CSW_KNIFE)
    {
        new 
Float:vec[3];
        new 
Float:oldvelo[3];
        
get_user_velocity(idoldvelo);
        
create_velocity_vector(id attacker vec);
        
vec[0] += oldvelo[0];
        
vec[1] += oldvelo[1];
        
set_user_velocity(id vec);
    }

    return 
PLUGIN_CONTINUE;
}

public 
Event_CurWeaponid )
{
    if (!
is_user_connected(id) || !is_user_alive(id) || zp_get_user_zombie(id))
        return 
PLUGIN_CONTINUE
    
    
new WeaponID read_data(2)
    if (
WeaponID != CSW_KNIFE)
        return  
PLUGIN_CONTINUE
    
    
#if (CUSTOM_MODELS)
        
entity_set_string(idEV_SZ_weaponmodelMODEL_PLAYER)
    
#endif
    
    
return PLUGIN_CONTINUE;


stock create_velocity_vector(victim,attacker,Float:velocity[3])
{
    if(!
zp_get_user_zombie(victim) || !is_user_alive(attacker))
        return 
0;

    new 
Float:vicorigin[3];
    new 
Float:attorigin[3];
    
entity_get_vector(victim   EV_VEC_origin vicorigin);
    
entity_get_vector(attacker EV_VEC_origin attorigin);

    new 
Float:origin2[3]
    
origin2[0] = vicorigin[0] - attorigin[0];
    
origin2[1] = vicorigin[1] - attorigin[1];

    new 
Float:largestnum 0.0;

    if(
floatabs(origin2[0])>largestnumlargestnum floatabs(origin2[0]);
    if(
floatabs(origin2[1])>largestnumlargestnum floatabs(origin2[1]);

    
origin2[0] /= largestnum;
    
origin2[1] /= largestnum;

    
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knock) * 3000) ) / get_entity_distance(victim attacker);
    
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knock) * 3000) ) / get_entity_distance(victim attacker);
    if(
velocity[0] <= 20.0 || velocity[1] <= 20.0)
        
velocity[2] = random_float(200.0 275.0);

    return 
1;
}

public 
plugin_precache()
{
    for(new 
0sizeof knife_soundsi++)
        
precache_sound(knife_sounds[i])

    
#if (CUSTOM_MODELS)
        
precache_model(MODEL_PLAYER)
    
#endif
}


public 
fw_EmitSound(idchannel, const sound[])
{
    if(!
is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || !get_pcvar_num(cvar_sounds))
        return 
FMRES_IGNORED
        
    
for(new 0sizeof knife_soundsi++)
    {
        if(
equal(soundoldknife_sounds[i]))
        {
            
emit_sound(idchannelknife_sounds[i], 1.0ATTN_NORM0PITCH_NORM)
            return 
FMRES_SUPERCEDE
        
}
    }
            
    return 
FMRES_IGNORED
}

public 
client_PreThink(id)
{
    if (!
is_user_connected(id) || !is_user_alive(id) || zp_get_user_zombie(id))
        return 
PLUGIN_CONTINUE

    
new temp[2], weapon get_user_weapon(idtemp[0], temp[1])
    if (
weapon != CSW_KNIFE)
        return 
PLUGIN_CONTINUE
        
    
if ((get_user_button(id) & IN_JUMP) && !(get_user_oldbutton(id) & IN_JUMP))
    {
        new 
flags entity_get_int(idEV_INT_flags)
        new 
waterlvl entity_get_int(idEV_INT_waterlevel)
        
        if (!(
flags FL_ONGROUND))
            return 
PLUGIN_CONTINUE
        
if (flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if (waterlvl 1)
            return 
PLUGIN_CONTINUE
                
        
new Float:fVelocity[3]
        
entity_get_vector(idEV_VEC_velocityfVelocity)
        
fVelocity[2] += get_pcvar_num(cvar_jump)
        
        
entity_set_vector(idEV_VEC_velocityfVelocity)
        
entity_set_int(idEV_INT_gaitsequence6)
    }
    return 
PLUGIN_CONTINUE;
}  

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if(
victim!=attacker)
    {
        if(
is_user_connected(attacker))
        {
            if(
get_user_weapon(attacker) == CSW_KNIFE && !zp_get_user_zombie(attacker))
            {
                
SetHamParamFloat(4damage get_pcvar_float(cvar_damage_human))
            }
            else if(
get_user_weapon(attacker) == CSW_KNIFE && zp_get_user_survivor(attacker))
            {
                
SetHamParamFloat(4damage get_pcvar_float(cvar_damage_survivor))
            }
        }
    }

Rx3toofan is offline
Rx3toofan
Member
Join Date: Jul 2014
Old 08-21-2014 , 05:12   Re: Zombie CSO theme problem
Reply With Quote #19

Here is new error

L 08/21/2014 - 11:10:40: [ENGINE] Invalid entity 82
L 08/21/2014 - 11:10:41: [AMXX] Displaying debug trace (plugin "zp_zclass_revenant_ice.amxx")
L 08/21/2014 - 11:10:41: [AMXX] Run time error 10: native error (native "entity_set_float")
L 08/21/2014 - 11:10:41: [AMXX] [0] zp_zclass_revenant_ice.sma::ball_think (line 244)


Sma


PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <cstrike>
#include <xs>
#include <zmvip>

new const ball_name[] = "paralize_ball"
new const ball_model[] = "models/w_hiddentail2.mdl"
new const ball_soundtouch[] = { "warcraft3/frostnova.wav" }

new const 
zclass_name[] = { "Revenant Zombie[VIP]" // name
new const zclass_info[] = { "/r[G]Frozen Nade [VIP]" // description
new const zclass_model[] = { "revenant_ice" // model
new const zclass_clawmodel[] = { "v_revenant_ice.mdl" // claw model
const zclass_health 5000 // health
const zclass_speed 275 // speed
const Float:zclass_gravity 0.6 // gravity
const Float:zclass_knockback 1.0 // knockback
new const v_zombie_bomb_model[64] = "revenant_ice"

new g_CurWeapon[33], g_bombmodelwpn[64]

#define OFFSET_MODELINDEX 491
#define OFFSET_LINUX 5 

new indexdefaultindex

new g_zclassparalize
new cvar_paralizedelay cvar_paralizevelocity  cvar_paralizeballhealth cvar_paralizeballparalizetime
new sTrail g_touchs[512] , g_can[33] , g_paralizen[33]

new const 
WeaponNames[][] =
{
        
"""weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
        
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
        
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
        
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
        
"weapon_ak47""weapon_knife""weapon_p90"
}

public 
plugin_init()
{
    
register_plugin("[ZP] Zombie Class: Revenant Ice""1.0""=), LARS-BLOODLIKER")

    
cvar_paralizedelay register_cvar("zp_classparalize_delay","15")
    
cvar_paralizevelocity register_cvar("zp_classparalizeball_velocity","1300")
    
cvar_paralizeballhealth register_cvar("zp_classparalizeball_health","5")
    
cvar_paralizeballparalizetime register_cvar "zp_classparalizeball_paralizetime""7.0" )

    
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_touch(ball_name"player",            "touchPlayer")
    
register_think(ball_name,"ball_think")

    
register_clcmd("drop","paralize_cmd")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_forward(FM_PlayerPreThink"fw_PreThink")

    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")

    
register_event("CurWeapon""Event_CurrentWeapon""be""1=1")
    
    for(new 
1sizeof WeaponNamesi++)
    if(
WeaponNames[i][0]) RegisterHam(Ham_Item_DeployWeaponNames[i], "fw_Weapon_Deploy_Post"1)

    
RegisterHam(Ham_Player_Duck"player""Player_Duck"1)
}

public 
plugin_precache()
{
    
precache_model(ball_model)
    
sTrail precache_model("sprites/laserbeam.spr")

    
g_zclassparalize zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    

    
formatex(g_bombmodelwpncharsmax(g_bombmodelwpn), "models/zombie_plague/v_bomb_%s.mdl"v_zombie_bomb_model)
    
engfunc(EngFunc_PrecacheModelg_bombmodelwpn)

    
index precache_model("models/player/revenant_ice/revenant_ice.mdl")
        
defaultindex precache_model("models/player.mdl")
}

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

    if(
g_can[id]) 
    {
        
client_print(id,print_center,"Recover in %d seconds",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_touchs
[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_BOUNCEMISSILE)
    
    
entity_set_edict(ballEV_ENT_ownerid)
    
    
entity_set_int(ballEV_INT_effectsEF_BRIGHTLIGHT)
    
    
VelocityByAim(idget_pcvar_num(cvar_paralizevelocity ), fVelocity)
    
entity_set_vector(ball EV_VEC_velocityfVelocity)

    
fm_set_rendering(ballkRenderFxGlowShell,255255255kRenderNormal16)
    
    
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(100// Red
    
write_byte(255// Green
    
write_byte(255// Blue
    
write_byte(255// Alpha
    
message_end() 

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

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

    
entity_set_float(ballEV_FL_health get_pcvar_float(cvar_paralizeballhealth))

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1
    
    return 
PLUGIN_HANDLED;
}

public 
touchWorld(ballworld) {

    
emit_sound(ballCHAN_WEAPONball_soundtouch1.0ATTN_NORM0PITCH_NORM)
    
g_touchs[ball] += 1
    
if(g_touchs[ball] == get_pcvar_num(cvar_paralizeballhealth)) remove_entity(ball)
    
    return 
PLUGIN_HANDLED
}

public 
touchPlayer(ballplayer) {
    
client_print(0,print_chat,"You are trapped in %d",player)
    
remove_task(player)
    
paralize(player)
    
//set_task(get_pcvar_float(cvar_paralizeballparalizetime),"unparalize_player",player)
    
    
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++)
    {
        if(
g_paralizen[i]) fm_set_rendering(i)
        
g_can[i] = 0
        g_paralizen
[i] = 0
        remove_task
(i)
    }
}

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:Velocity[3]
    
pev(ball,pev_velocity,Velocity)

    if(
Velocity[0] < 1.0 && Velocity[2] < 1.0 && Velocity[1] < 1.0remove_entity(ball)

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1

}

public 
paralize(id)
{
    if(!
is_user_alive(id) || zp_get_user_zombie(id))
        return;

    
g_paralizen[id] = 1
    fm_set_rendering
(idkRenderFxGlowShell,100255255kRenderNormal16)
    
set_task(get_pcvar_float(cvar_paralizeballparalizetime),"unparalize_player",id)
}

public 
unparalize_player(id)
{
    if(!
is_user_alive(id) || zp_get_user_zombie(id))
        return;

    
g_paralizen[id] = 0
    fm_set_rendering
(id)
}

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,"ability active!")
    if(
g_can[id]) set_task(1.0,"ability_zero",id)
}

public 
fw_PreThink(id)
{
    if( !
is_user_alive(id) || zp_get_user_zombie(id) || !g_paralizen[id])
        return 
PLUGIN_CONTINUE;

    
set_pevidpev_buttonpev(id,pev_button) & ~IN_ATTACK );

    
set_pev(idpev_maxspeed0.0)        

    new 
Float:vel[3]
    
set_pev(id,pev_velocity,vel)

    return 
PLUGIN_HANDLED
}

public 
zp_user_humanized_post(id)
{
    
fm_set_user_model_index(iddefaultindex)

     
remove_values(id)
}
public 
fw_PlayerKilled(idattackershouldgibremove_values(id)
public 
client_connect(id)  remove_values(id)

public 
zp_user_infected_post(id
{
    
set_wpnmodel(id)
    if((
zp_get_user_zombie_class(id) == g_zclassparalize) && (zp_get_user_zombie(id)))
    {
        
fm_set_user_model_index(idindex)
    }
    
remove_values(id)
}

public 
zp_user_infected_pre(id) {
    if(
zv_get_user_flags(id) == 0) {
        if(
zp_get_user_next_class(id) == g_zclassparalize) {
            
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.")
        }
    }
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:color[3]
    
color[0] = float(r)
    
color[1] = float(g)
    
color[2] = float(b)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))
}

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);
}

public 
Event_CurrentWeapon(idg_CurWeapon[id] = read_data(2)

public 
fw_Weapon_Deploy_Post(weapon_ent)
{
    static 
idid get_pdata_cbase(weapon_ent414)

    static 
weaponidweaponid cs_get_weapon_id(weapon_ent)

    
g_CurWeapon[id] = weaponid
    
    replace_weapon_models
(idweaponid)
}

public 
Player_Duck(id)
{
    if(
zp_get_user_zombie_class(id) == g_zclassparalize && zp_get_user_zombie(id))
    {
           static 
buttonducking
           button 
pev(idpev_button)
        
ducking pev(idpev_flags) & (FL_DUCKING FL_ONGROUND) == (FL_DUCKING FL_ONGROUND)

           if(
button IN_DUCK || ducking)
        {
            
set_pev(idpev_view_ofs, {0.00.020.0})   
           }
    }
}

set_wpnmodel(id)
{
    if(!
is_user_alive(id)) return

    new 
wpn get_user_weapon(id)

    if(
wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE)
    {
            
set_pev(idpev_viewmodel2g_bombmodelwpn)
    }
}

replace_weapon_models(idweaponid)
{
    if(
zp_get_user_zombie_class(id) == g_zclassparalize && zp_get_user_zombie(id))
    {
        switch(
weaponid)
        {
            case 
CSW_HEGRENADE:
            {
                
set_pev(idpev_viewmodel2g_bombmodelwpn)
            }
            case 
CSW_SMOKEGRENADE:
            {
                
set_pev(idpev_viewmodel2g_bombmodelwpn)
            }
            case 
CSW_FLASHBANG:
            {
                
set_pev(idpev_viewmodel2g_bombmodelwpn)
            }
        }
    }
}

stock fm_set_user_model_index(idvalue)
{
    
set_pdata_int(idOFFSET_MODELINDEXvalueOFFSET_LINUX)

Rx3toofan is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-21-2014 , 05:36   Re: Zombie CSO theme problem
Reply With Quote #20

Just try to edit this:
PHP Code:
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:Velocity[3]
    
pev(ball,pev_velocity,Velocity)

    if(
Velocity[0] < 1.0 && Velocity[2] < 1.0 && Velocity[1] < 1.0remove_entity(ball)

    
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1


-->
PHP Code:
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:Velocity[3]
    
pev(ball,pev_velocity,Velocity)

    if(
Velocity[0] < 1.0 && Velocity[2] < 1.0 && Velocity[1] < 1.0remove_entity(ball)

    if (
pev_valid(ent))
    {
        
entity_set_float(ballEV_FL_nextthinkget_gametime() + 0.1
    }    

zmd94 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 16:34.


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