Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
|
08-06-2012
, 16:45
{help} tank, spitter zombie
|
#1
|
HI, I GOT PROBLEM WITH TANK AND SPITTER ZOMBIE.
HERES THE LOG
PHP Code:
L 08/07/2012 - 03:10:00: [ENGINE] Invalid entity 114
L 08/07/2012 - 03:10:00: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:00: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:00: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:22: [ENGINE] Invalid entity 123
L 08/07/2012 - 03:10:22: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:22: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:22: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:24: [ENGINE] Invalid entity 119
L 08/07/2012 - 03:10:24: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:24: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:24: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:28: [ENGINE] Invalid entity 122
L 08/07/2012 - 03:10:28: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:28: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:28: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:29: [ENGINE] Invalid entity 125
L 08/07/2012 - 03:10:29: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:29: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:29: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:48: [ENGINE] Invalid entity 130
L 08/07/2012 - 03:10:48: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:48: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:48: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:57: [ENGINE] Invalid entity 126
L 08/07/2012 - 03:10:57: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:57: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:57: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:58: [ENGINE] Invalid entity 125
L 08/07/2012 - 03:10:58: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:58: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:58: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:58: [ENGINE] Invalid entity 126
L 08/07/2012 - 03:10:58: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:58: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:58: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:10:59: [ENGINE] Invalid entity 121
L 08/07/2012 - 03:10:59: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:10:59: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:10:59: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:04: [ENGINE] Invalid entity 116
L 08/07/2012 - 03:11:04: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:04: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:04: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:05: [ENGINE] Invalid entity 120
L 08/07/2012 - 03:11:05: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:05: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:05: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:05: [ENGINE] Invalid entity 136
L 08/07/2012 - 03:11:05: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:05: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:05: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:05: [ENGINE] Invalid entity 129
L 08/07/2012 - 03:11:05: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:05: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:05: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:06: [ENGINE] Invalid entity 115
L 08/07/2012 - 03:11:06: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:06: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:06: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:24: [ENGINE] Invalid entity 133
L 08/07/2012 - 03:11:24: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:24: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:24: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:25: [ENGINE] Invalid entity 133
L 08/07/2012 - 03:11:25: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:25: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:25: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:29: [ENGINE] Invalid entity 124
L 08/07/2012 - 03:11:29: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:29: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:29: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:30: [ENGINE] Invalid entity 116
L 08/07/2012 - 03:11:30: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:30: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:30: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:39: [ENGINE] Invalid entity 128
L 08/07/2012 - 03:11:39: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:39: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:39: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:40: [ENGINE] Invalid entity 118
L 08/07/2012 - 03:11:40: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:40: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:40: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:42: [ENGINE] Invalid entity 122
L 08/07/2012 - 03:11:42: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:42: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:42: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:43: [ENGINE] Invalid entity 129
L 08/07/2012 - 03:11:43: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:43: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:43: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:44: [ENGINE] Invalid entity 136
L 08/07/2012 - 03:11:44: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:44: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:44: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:11:47: [ENGINE] Invalid entity 128
L 08/07/2012 - 03:11:47: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:11:47: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:11:47: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:19: [ENGINE] Invalid entity 126
L 08/07/2012 - 03:12:19: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:19: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:19: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 132
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 133
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 136
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 137
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 138
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 140
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 141
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 142
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 144
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 145
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 115
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
L 08/07/2012 - 03:12:51: [ENGINE] Invalid entity 116
L 08/07/2012 - 03:12:51: [AMXX] Displaying debug trace (plugin "zp_zclass_tank.amxx")
L 08/07/2012 - 03:12:51: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/07/2012 - 03:12:51: [AMXX] [0] zp_zclass_tank.sma::RockTouch (line 109)
AND THE CODE
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <engine>
#include <fun>
#include <hamsandwich>
new const zclass_name[] = { "L4D Tank Zombie" }
new const zclass_info[] = { "\rChuluu shidej ammo oloh [R]" }
new const zclass_model[] = { "l4d_tank" }
new const zclass_clawmodel[] = { "v_tank.mdl" }
const zclass_health = 5800
const zclass_speed = 240
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
new g_L4dTank
new g_trailSprite, rockmodel
new g_trail[] = "sprites/xopom_trail.spr"
new rock_model[] = "models/rockgibs.mdl"
new rock_model2[] = "models/rockgibs.mdl"
new tank_rocklaunch[] = "zombie_plague/tank_rocklaunch.wav"
new g_power[33]
new cvar_rock_damage, cvar_rock_reward, cvar_rockmode, cvar_rockEnergyNesesary, cvar_rock_speed, cvar_reloadpower
public plugin_init()
{
register_plugin("[XopoM] ZClass: L4D Tank", "1.2", "x[L]eoNNN")
cvar_rock_speed = register_cvar("zp_tank_rockspeed", "700")
cvar_rock_damage = register_cvar("zp_tank_rockdamage", "40")
cvar_rock_reward = register_cvar("zp_tank_rockreward", "5")
cvar_rockmode = register_cvar("zp_tank_rockmode", "1")
cvar_rockEnergyNesesary = register_cvar("zp_tank_rock_energynesesary", "10")
cvar_reloadpower = register_cvar("zp_tank_reload_power", "1")
register_touch("rock_ent","*","RockTouch")
register_forward(FM_CmdStart, "CmdStart" )
}
public plugin_precache()
{
g_L4dTank = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
rockmodel = precache_model(rock_model)
g_trailSprite = precache_model(g_trail)
precache_sound(tank_rocklaunch)
}
public zp_user_infected_post ( id, infector )
{
if (zp_get_user_zombie_class(id) == g_L4dTank)
{
print_chatColor(id, "\g[XopoM]\n Ta\g R\n useg ashiglaj chuluu shidej ammo oloh bolomjtoi")
g_power[id] = get_pcvar_num(cvar_rockEnergyNesesary)
set_task(get_pcvar_float(cvar_reloadpower), "power1", id, _, _, "b")
}
}
public CmdStart( const id, const uc_handle, random_seed )
{
if(!is_user_alive(id))
return FMRES_IGNORED;
if(!zp_get_user_zombie(id) || zp_get_user_nemesis(id))
return FMRES_IGNORED;
new button = pev(id, pev_button)
new oldbutton = pev(id, pev_oldbuttons)
if (zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_L4dTank))
if(oldbutton & IN_RELOAD && !(button & IN_RELOAD))
{
if(g_power[id] >= get_pcvar_num(cvar_rockEnergyNesesary))
{
MakeRock(id)
emit_sound(id, CHAN_STREAM, tank_rocklaunch, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
g_power[id] = 0
}
else
{
set_hudmessage(255, 0, 0, 0.0, 0.6, 0, 6.0, 3.0)
show_hudmessage(id, "[XopoM] Chuluund shaardah energy [%d] | Tanii energy [%d]", get_pcvar_num(cvar_rockEnergyNesesary), g_power[id])
}
}
return FMRES_IGNORED
}
public power1(id)
{
g_power[id] += 1
if( g_power[id] > get_pcvar_num(cvar_rockEnergyNesesary) )
{
g_power[id] = get_pcvar_num(cvar_rockEnergyNesesary)
}
}
public RockTouch( RockEnt, Touched )
{
if ( !pev_valid ( RockEnt ) )
return
static Class[ 32 ]
entity_get_string( Touched, EV_SZ_classname, Class, charsmax( Class ) )
new Float:origin[3]
pev(Touched,pev_origin,origin)
if( equal( Class, "player" ) )
if (is_user_alive(Touched))
{
if(!zp_get_user_zombie(Touched))
{
new TankKiller = entity_get_edict( RockEnt, EV_ENT_owner )
switch(get_pcvar_num(cvar_rockmode))
{
case 1: // Health
{
new iHealth = get_user_health(Touched)
if( iHealth >= 1 && iHealth <= get_pcvar_num(cvar_rock_damage))
{
ExecuteHamB( Ham_Killed, Touched, TankKiller, 0 )
print_chatColor(TankKiller, "\g[XopoM]\n Ta \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_rock_reward))
zp_set_user_ammo_packs(TankKiller, zp_get_user_ammo_packs(TankKiller) + get_pcvar_num(cvar_rock_reward))
}
else
{
set_user_health(Touched, get_user_health(Touched) - get_pcvar_num(cvar_rock_damage))
print_chatColor(TankKiller, "\g[XopoM]\n Ta \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_rock_reward))
zp_set_user_ammo_packs(TankKiller, zp_get_user_ammo_packs(TankKiller) + get_pcvar_num(cvar_rock_reward))
}
}
case 2: // Kill
{
if(zp_get_user_survivor(Touched))
return
ExecuteHamB( Ham_Killed, Touched, TankKiller, 0 )
zp_set_user_ammo_packs(TankKiller, zp_get_user_ammo_packs(TankKiller) + get_pcvar_num(cvar_rock_reward))
print_chatColor(TankKiller, "\g[XopoM]\n Ta \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_rock_reward))
}
case 3: //infect
{
if(zp_get_user_survivor(Touched))
return
zp_infect_user(Touched, TankKiller, 1, 1)
print_chatColor(TankKiller, "\g[XopoM]\n Ta \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_rock_reward))
zp_set_user_ammo_packs(TankKiller, zp_get_user_ammo_packs(TankKiller) + get_pcvar_num(cvar_rock_reward))
}
case 4: //BadAim
{
new Float:vec[3] = {100.0,100.0,100.0}
entity_set_vector(Touched,EV_VEC_punchangle,vec)
entity_set_vector(Touched,EV_VEC_punchangle,vec)
entity_set_vector(Touched,EV_VEC_punchangle,vec)
print_chatColor(TankKiller, "\g[XopoM]\n Ta \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_rock_reward))
zp_set_user_ammo_packs(TankKiller, zp_get_user_ammo_packs(TankKiller) + get_pcvar_num(cvar_rock_reward))
set_task(1.50, "EndVictimAim", Touched)
}
}
}
}
if(equal(Class, "func_breakable") && entity_get_int(Touched, EV_INT_solid) != SOLID_NOT)
force_use(RockEnt, Touched)
remove_entity(RockEnt)
if(!is_user_alive(Touched))
return
static origin1[3]
get_user_origin(Touched, origin1)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, origin1);
write_byte(TE_BREAKMODEL);
write_coord(origin1[0]);
write_coord(origin1[1]);
write_coord(origin1[2] + 24);
write_coord(16);
write_coord(16);
write_coord(16);
write_coord(random_num(-50,50));
write_coord(random_num(-50,50));
write_coord(25);
write_byte(10);
write_short(rockmodel);
write_byte(10);
write_byte(25);
write_byte(0x01);
message_end();
}
public EndVictimAim(Touched)
{
new Float:vec[3] = {-100.0,-100.0,-100.0}
entity_set_vector(Touched,EV_VEC_punchangle,vec)
entity_set_vector(Touched,EV_VEC_punchangle,vec)
entity_set_vector(Touched,EV_VEC_punchangle,vec)
}
public MakeRock(id)
{
new Float:Origin[3]
new Float:Velocity[3]
new Float:vAngle[3]
new RockSpeed = get_pcvar_num(cvar_rock_speed)
entity_get_vector(id, EV_VEC_origin , Origin)
entity_get_vector(id, EV_VEC_v_angle, vAngle)
new NewEnt = create_entity("info_target")
entity_set_string(NewEnt, EV_SZ_classname, "rock_ent")
entity_set_model(NewEnt, rock_model2)
entity_set_size(NewEnt, Float:{-1.5, -1.5, -1.5}, Float:{1.5, 1.5, 1.5})
entity_set_origin(NewEnt, Origin)
entity_set_vector(NewEnt, EV_VEC_angles, vAngle)
entity_set_int(NewEnt, EV_INT_solid, 2)
entity_set_int(NewEnt, EV_INT_rendermode, 5)
entity_set_float(NewEnt, EV_FL_renderamt, 200.0)
entity_set_float(NewEnt, EV_FL_scale, 1.00)
entity_set_int(NewEnt, EV_INT_movetype, 5)
entity_set_edict(NewEnt, EV_ENT_owner, id)
velocity_by_aim(id, RockSpeed , Velocity)
entity_set_vector(NewEnt, EV_VEC_velocity ,Velocity)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW)
write_short(NewEnt)
write_short(g_trailSprite)
write_byte(10)
write_byte(10)
write_byte(120)
write_byte(120)
write_byte(120)
write_byte(200)
message_end()
return PLUGIN_HANDLED
}
stock print_chatColor(const id,const input[], any:...)
{
new msg[191], players[32], count = 1;
vformat(msg,190,input,3);
replace_all(msg,190,"\g","^4");// green
replace_all(msg,190,"\n","^1");// normal
replace_all(msg,190,"\t","^3");// team
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
AND THE SPITTER LOG
PHP Code:
L 08/06/2012 - 12:17:11: [ENGINE] Invalid entity 141
L 08/06/2012 - 12:17:11: [AMXX] Displaying debug trace (plugin "zp_class_spitter.amxx")
L 08/06/2012 - 12:17:11: [AMXX] Run time error 10: native error (native "entity_get_string")
L 08/06/2012 - 12:17:11: [AMXX] [0] zp_class_spitter.sma::spitTouch (line 195)
THE CODE
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <engine>
#include <fun>
#include <hamsandwich>
#define PLUGIN_NAME "[XopoM] ZClass: Spitter"
#define PLUGIN_VERSION "1.5"
#define PLUGIN_AUTHOR "snaker-beatter"
#define BETTER_COOLDOWN // Than the old buggy cooldown this works more better
#if defined BETTER_COOLDOWN
new Float:g_LastSpitTime[33]
new cvar_spit_cooldown
#endif
new const zclass_name[] = { "L4D Spitter" }
new const zclass_info[] = { "\rHuchileer nulimah" }
new const zclass_model[] = { "SpitterL4D2" }
new const zclass_clawmodel[] = { "v_Spitter_hands.mdl" }
const zclass_health = 4350
const zclass_speed = 250
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
new g_L4dSpitter
new g_trailSprite
new const g_trail[] = "sprites/xopom_trail.spr"
new const spit_model[] = "models/spit.mdl" // HAlF-Life model
new const Spitter_spitlaunch[] = "zombie_plague/spitter_spit.wav"
new const Spitter_spithit[] = "bullchicken/bc_spithit2.wav" // HAlF-Life model
new cvar_spit_damage, cvar_spit_reward, cvar_spitmode, cvar_spit_speed
new g_maxplayers
#define is_user_valid(%1) (1 <= %1 <= g_maxplayers)
/******************************************************
[Main event]
******************************************************/
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("DeathMsg", "spitter_death", "a")
cvar_spit_speed = register_cvar("zp_Spitter_spit_speed", "700")
cvar_spit_damage = register_cvar("zp_Spitter_spit_damage", "25")
cvar_spit_reward = register_cvar("zp_Spitter_spit_reward", "4")
cvar_spitmode = register_cvar("zp_Spitter_spit_mode", "1")
#if defined BETTER_COOLDOWN
cvar_spit_cooldown = register_cvar("zp_Spitter_spit_cooldown", "20")
#endif
register_clcmd("spitter_spit", "clcmd_spit")
register_touch("spit_ent","*","spitTouch")
register_forward(FM_PlayerPreThink, "CmdStart")
g_maxplayers = get_maxplayers()
}
/****************************************************
[Events]
****************************************************/
public plugin_precache()
{
g_L4dSpitter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_model(spit_model)
precache_sound(Spitter_spitlaunch)
precache_sound(Spitter_spithit)
g_trailSprite = precache_model(g_trail)
}
public zp_user_infected_post (id, infector)
{
if (zp_get_user_zombie_class(id) == g_L4dSpitter)
{
print_chatColor(id, "\g[XopoM]\n Ta \tR\n useg ashiglan nulimj bolno")
}
}
public CmdStart(id)
{
new button = pev(id, pev_button)
new oldbutton = pev(id, pev_oldbuttons)
if (zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_L4dSpitter))
{
if(oldbutton & IN_RELOAD && !(button & IN_RELOAD))
{
clcmd_spit(id)
}
}
return FMRES_IGNORED
}
public clcmd_spit(id)
{
if(!is_user_alive(id))
{
print_chatColor(id, "\g[XopoM]\n Ta uhsen uchir \tnulimah\n bolomjgui")
return PLUGIN_HANDLED
}
if (zp_get_user_zombie(id))
{
if (zp_get_user_zombie_class(id) == g_L4dSpitter)
{
if (get_gametime() - g_LastSpitTime[id] < get_pcvar_float(cvar_spit_cooldown))
{
print_chatColor(id, "\g[XopoM]\n Ta \t%.f0 sec\n huleene uu", get_pcvar_float(cvar_spit_cooldown) - (get_gametime() - g_LastSpitTime[id]))
return PLUGIN_HANDLED;
}
Makespit(id)
emit_sound(id, CHAN_STREAM, Spitter_spitlaunch, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
g_LastSpitTime[id] = get_gametime()
}
}
else
{
print_chatColor(id, "\g[XopoM]\n Ta \tspitter zombie\n bish uchir nulimah bolomjgui")
return PLUGIN_HANDLED
}
if (zp_get_user_survivor(id))
{
print_chatColor(id, "\g[XopoM]\n Ta \tspitter zombie\n bish uchir nulimah bolomjgui")
return PLUGIN_HANDLED
}
if (zp_get_user_nemesis(id))
{
print_chatColor(id, "\g[XopoM]\n Ta \tspitter zombie\n bish uchir nulimah bolomjgui")
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public spitTouch(spitEnt, Touched)
{
if(!is_valid_ent(spitEnt)) return;
if(is_user_valid(Touched))
{
if(is_user_alive(Touched) && !zp_get_user_zombie(Touched))
{
new SpitterKiller = entity_get_edict(spitEnt, EV_ENT_owner)
switch(get_pcvar_num(cvar_spitmode))
{
case 1: // Health mode
{
new iHealth = get_user_health(Touched)
if(iHealth >= 1 && iHealth <= get_pcvar_num(cvar_spit_damage))
{
emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
ExecuteHamB(Ham_Killed, Touched, SpitterKiller, 0)
print_chatColor(SpitterKiller, "\g[XopoM]\n Ta onovchtoi nulimaj \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_spit_reward))
zp_set_user_ammo_packs(SpitterKiller, zp_get_user_ammo_packs(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
}
else
{
emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_user_health(Touched, get_user_health(Touched) - get_pcvar_num(cvar_spit_damage))
print_chatColor(SpitterKiller, "\g[XopoM]\n Ta onovchtoi nulimaj \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_spit_reward))
zp_set_user_ammo_packs(SpitterKiller, zp_get_user_ammo_packs(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
}
}
case 2: // Kill mode
{
emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
ExecuteHamB(Ham_Killed, Touched, SpitterKiller, 0)
zp_set_user_ammo_packs(SpitterKiller, zp_get_user_ammo_packs(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
print_chatColor(SpitterKiller, "\g[XopoM]\n Ta onovchtoi nulimaj \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_spit_reward))
}
case 3: //infect mode
{
emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
zp_infect_user(Touched, SpitterKiller, 1, 1)
print_chatColor(SpitterKiller, "\g[XopoM]\n Ta onovchtoi nulimaj \t%d\n ammo bagts huleen avlaa", get_pcvar_num(cvar_spit_reward))
zp_set_user_ammo_packs(SpitterKiller, zp_get_user_ammo_packs(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
}
}
/*static origin1[3]
get_user_origin(Touched, origin1)*/
}
}
else
{
static Class[32]
entity_get_string(Touched, EV_SZ_classname, Class, charsmax(Class))
if(equal(Class, "func_breakable") && entity_get_int(Touched, EV_INT_solid) != SOLID_NOT)
{
force_use(spitEnt, Touched)
}
}
remove_entity(spitEnt)
}
public Makespit(id)
{
new Float:Origin[3]
new Float:Velocity[3]
new Float:vAngle[3]
new spitSpeed = get_pcvar_num(cvar_spit_speed)
entity_get_vector(id, EV_VEC_origin , Origin)
entity_get_vector(id, EV_VEC_v_angle, vAngle)
new NewEnt = create_entity("info_target")
entity_set_string(NewEnt, EV_SZ_classname, "spit_ent")
entity_set_model(NewEnt, spit_model)
entity_set_size(NewEnt, Float:{-1.5, -1.5, -1.5}, Float:{1.5, 1.5, 1.5})
entity_set_origin(NewEnt, Origin)
entity_set_vector(NewEnt, EV_VEC_angles, vAngle)
entity_set_int(NewEnt, EV_INT_solid, 2)
entity_set_int(NewEnt, EV_INT_rendermode, 5)
entity_set_float(NewEnt, EV_FL_renderamt, 200.0)
entity_set_float(NewEnt, EV_FL_scale, 1.00)
entity_set_int(NewEnt, EV_INT_movetype, 5)
entity_set_edict(NewEnt, EV_ENT_owner, id)
velocity_by_aim(id, spitSpeed , Velocity)
entity_set_vector(NewEnt, EV_VEC_velocity ,Velocity)
return PLUGIN_HANDLED
}
public spit_trail(id, Entity)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW)
write_short(Entity)
write_short(g_trailSprite)
write_byte(10)
write_byte(10)
write_byte(0)
write_byte(200)
write_byte(0)
write_byte(200)
message_end()
}
public spitter_death()
{
new id = read_data(2)
if (zp_get_user_zombie(id))
{
if (zp_get_user_zombie_class(id) == g_L4dSpitter)
{
new Float:originF[3]
pev(id, pev_origin, originF);
}
}
}
public spit_death(id, const Float:originF[3])
{
if (zp_get_user_survivor(id))
{
return PLUGIN_HANDLED
}
if (zp_get_user_nemesis(id))
{
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
stock print_chatColor(id,const input[], any:...)
{
new msg[191], players[32], count = 1;
vformat(msg,190,input,3);
replace_all(msg,190,"\g","^4");// green
replace_all(msg,190,"\n","^1");// normal
replace_all(msg,190,"\t","^3");// team
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
PLEASE SOMEONE HELP IVE GOT TIRED OF THIS.
__________________
|
|