Raised This Month: $ Target: $400
 0% 

[zp] nst tank -> zp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
saharmie
Junior Member
Join Date: Sep 2010
Location: Brunei
Old 08-08-2011 , 06:14   [zp] nst tank -> zp
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <fun>
#define PLUGIN "NST Zombie Class Tank"
#define VERSION "1.0"
#define AUTHOR "NST"
new spr_skill[] = "g_fastrun"
new g_zclass_sprint
new const zclass_name[] = "Tank" // name
new const zclass_info[] = "Normal Zombie" // description
new const zclass_model[] = "tank_zombi_host" // model
new const zclass_clawmodel[] = "v_knife_tank_zombi.mdl" // claw model
const zclass_health 2000 
const zclass_speed 240
const Float:zclass_gravity 0.9 
const Float:zclass_knockback 2.0
new Float:fastrun_time 8.0
new Float:fastrun_timewait 20.0
new Float:fastrun_speed 350.0
new const sound_fastrun_start[] = "zombi/zombi_pressure.wav"
new const sound_fastrun_heartbeat[2][] = { "zombi/zombi_pre_idle_1.wav" "zombi/zombi_pre_idle_2.wav" }
new Array:
fastrun_glowshell_color "255,003,000"
new Array:fastrun_fov 105
new g_fastrun[33], g_fastrun_wait[33], g_check[33], g_msgStatusIcong_current_speed[33]
// Task offsets
enum (+= 100)
{
 
TASK_FASTRUN 2000,
 
TASK_FASTRUN_HEARTBEAT,
 
TASK_FASTRUN_WAIT,
 
TASK_BOT_USE_SKILL
}
// IDs inside tasks
#define ID_FASTRUN (taskid - TASK_FASTRUN)
#define ID_FASTRUN_HEARTBEAT (taskid - TASK_FASTRUN_HEARTBEAT)
#define ID_FASTRUN_WAIT (taskid - TASK_FASTRUN_WAIT)
#define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)
 
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
// Language files
 
register_dictionary("zombie_plague.txt")
 
 
// msg
 
g_msgStatusIcon get_user_msgid("StatusIcon")
 
 
// Events
 
register_logevent("logevent_round_start",2"1=Round_Start")
 
register_event("HLTV""event_round_start""a""1=0""2=0")
 
register_event("DeathMsg""Death""a")
 
register_forward(FM_CmdStart"fw_CmdStart")
 
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
 
register_forward(FM_EmitSound"EmitSound"
 
 
// clien cmd
 //register_concmd("ww", "ww")
 
register_clcmd("drop""cmd_fastrun")
}
public 
plugin_precache()

 
precache_sound(sound_fastrun_start)
 
 
engfunc(EngFunc_PrecacheSoundsound_fastrun_start)
 
 
// register zombie class
 
g_zclass_sprint zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}
public 
event_round_start()
{
 for (new 
id=1id<33id++)
 {
  if (!
is_user_connected(id)) continue;
 
  
reset_value_player(id)
  
StatusIcon(idspr_skill0)
 }
}
public 
logevent_round_start()
{
 for (new 
id=1id<33id++)
 {
  if (!
is_user_connected(id)) continue;
  if (
is_user_bot(id))
  {
   if (
task_exists(id+TASK_BOT_USE_SKILL)) remove_task(id+TASK_BOT_USE_SKILL)
   
set_task(float(random_num(5,15)), "bot_use_skill"id+TASK_BOT_USE_SKILL)
  }
 }
}
public 
Death()
{
 new 
victim read_data(2
 
 
StatusIcon(victimspr_skill0)
 
reset_value_player(victim)
}
reset_value_player(id)
{
 if (
task_exists(id+TASK_FASTRUN)) remove_task(id+TASK_FASTRUN)
 if (
task_exists(id+TASK_FASTRUN_HEARTBEAT)) remove_task(id+TASK_FASTRUN_HEARTBEAT)
 if (
task_exists(id+TASK_FASTRUN_WAIT)) remove_task(id+TASK_FASTRUN_WAIT)
 if (
task_exists(id+TASK_BOT_USE_SKILL)) remove_task(id+TASK_BOT_USE_SKILL)
 
 
g_fastrun[id] = 0
 g_fastrun_wait
[id] = 0
 g_check
[id] = 0
}
// bot use skill
public bot_use_skill(taskid)
{
 new 
id ID_BOT_USE_SKILL
 
if (!is_user_bot(id)) return;
 
cmd_fastrun(id)
 if (
task_exists(taskid)) remove_task(taskid)
 
set_task(float(random_num(5,15)), "bot_use_skill"id+TASK_BOT_USE_SKILL)
}
// #################### FASTRUN PUBLIC ####################
// Cmd fast run
public cmd_fastrun(id)
{
 if (
g_zclass_sprint==zp_get_user_zombie_class(id) && zp_get_user_zombie(id) && !g_fastrun[id] && !g_fastrun_wait[id])
 {
  
// set current speed
  
pev(idpev_maxspeedg_current_speed[id])
 
  
// set fastrun
  
g_fastrun[id] = 1
 
  
// set glow shell
  
new color[3]
  
color[0] = ArrayGetCell(fastrun_glowshell_color0)
  
color[1] = ArrayGetCell(fastrun_glowshell_color1)
  
color[2] = ArrayGetCell(fastrun_glowshell_color2)
  
fm_set_rendering(idkRenderFxGlowShellcolor[0], color[1], color[2], kRenderNormal0)
  
// set effect
  
EffectFastrun(idfastrun_fov)
 
  
// task fastrun
  
new Float:timerun
  timerun 
fastrun_time
  
if (task_exists(id+TASK_FASTRUN)) remove_task(id+TASK_FASTRUN)
  
set_task(timerun"RemoveFastRun"id+TASK_FASTRUN)
 
  
// play sound start
  
engfunc(EngFunc_EmitSoundidCHAN_AUTOsound_fastrun_start1.0ATTN_NORM0PITCH_NORM)
 
  
// task fastrun sound heartbeat
  
if (task_exists(id+TASK_FASTRUN_HEARTBEAT)) remove_task(id+TASK_FASTRUN_HEARTBEAT)
  
set_task(2.0"FastRunHeartBeat"id+TASK_FASTRUN_HEARTBEAT__"b")
  return 
PLUGIN_HANDLED
 
}
 
 return 
PLUGIN_CONTINUE
}
public 
RemoveFastRun(taskid)
{
 new 
id ID_FASTRUN
 g_fastrun
[id] = 0
 set_pev
(idpev_maxspeedg_current_speed[id])
 
fm_set_rendering(id)
 
EffectFastrun(id)
 if (
task_exists(taskid)) remove_task(taskid)
 
 new 
Float:timewait fastrun_timewait
 timewait 
0.5
 g_fastrun_wait
[id] = 1
 
if (task_exists(id+TASK_FASTRUN_WAIT)) remove_task(id+TASK_FASTRUN_WAIT)
 
set_task(timewait"RemoveWaitFastRun"id+TASK_FASTRUN_WAIT)
}
public 
RemoveWaitFastRun(taskid)
{
 new 
id ID_FASTRUN_WAIT
 g_fastrun_wait
[id] = 0
 
if (task_exists(taskid)) remove_task(taskid)
}
public 
FastRunHeartBeat(taskid)
{
 new 
id ID_FASTRUN_HEARTBEAT
 
 
if (g_fastrun[id])
 
engfunc(EngFunc_EmitSoundidCHAN_AUTOsound_fastrun_heartbeat1.0ATTN_NORM0PITCH_NORM)
 else if (
task_exists(taskid)) remove_task(taskid)
}
// show hide spr
public fw_CmdStart(iduc_handleseed)
{
 if (!
is_user_alive(id)) return;
 
 if (
g_zclass_sprint==zp_get_user_zombie_class(id) && zp_get_user_zombie(id))
 {
  
// show status icon help
  
if ( (g_fastrun[id] || g_fastrun_wait[id]) && g_check[id] != 2)
  {
   
g_check[id] = 2
   StatusIcon
(idspr_skill2)
  }
  else if (
g_check[id] != 1)
  {
   
g_check[id] = 1
   StatusIcon
(idspr_skill1)
  }
 }
 else if (
g_check[id])
 {
  
// hide status icon
  
g_check[id] = 0
  StatusIcon
(idspr_skill0)
 }
 
 
 return;
}
// set speed
public fw_PlayerPreThink(id)
{
 if (!
is_user_alive(id)) return;
 
 if (
g_zclass_sprint==zp_get_user_zombie_class(id) && zp_get_user_zombie(id) && g_fastrun[id])
 {
  
set_pev(idpev_maxspeedfastrun_speed)
 }
}
// MAIN FUNCTION
StatusIcon(idsprname[], run)

 if (!
is_user_connected(id)) return;
 
 
message_begin(MSG_ONEg_msgStatusIcon, {0,0,0}, id);
 
write_byte(run); // status (0=hide, 1=show, 2=flash)
 
write_string(sprname); // sprite name
 
message_end();
}
fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16
{
 new 
Float:RenderColor[3];
 
RenderColor[0] = float(r);
 
RenderColor[1] = float(g);
 
RenderColor[2] = float(b);
 
set_pev(entitypev_renderfxfx);
 
set_pev(entitypev_rendercolorRenderColor);
 
set_pev(entitypev_rendermoderender);
 
set_pev(entitypev_renderamtfloat(amount));
 return 
1;
}
EffectFastrun(idnum 90)
{
 
message_begin(MSG_ONEget_user_msgid("SetFOV"), {0,0,0}, id)
 
write_byte(num)
 
message_end()
}
// OTHER PUNLIC
public ww(id)
{
 for (new 
id 1id <= 32id++)
 {
  
cmd_fastrun(id)
 }
 
client_print(idprint_chat"[%s][%s][%i][%i][%i]"zclass_modelzclass_gravityzclass_speedzclass_knockback)
 
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
(2 error 006 : must be assigned to an arraynew Array:fastrun_fov = 105

(152) : warning 213: tag mismatch
EffectFastrun(id, fastrun_fov)
__________________

saharmie is offline
Send a message via MSN to saharmie
 



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 03:18.


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