AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [zp] nst tank -> zp (https://forums.alliedmods.net/showthread.php?t=164170)

saharmie 08-08-2011 06:14

[zp] nst tank -> zp
 
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 8) error 006 : must be assigned to an arraynew Array:fastrun_fov = 105

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

yokomo 08-08-2011 07:04

Re: [zp] nst tank -> zp
 
Try it.
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"
const fastrun_glowshell_color_r 255
const fastrun_glowshell_color_g 3
const fastrun_glowshell_color_b 0
//new Array:fastrun_fov = 105
const 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_color, 0)
  color[1] = ArrayGetCell(fastrun_glowshell_color, 1)
  color[2] = ArrayGetCell(fastrun_glowshell_color, 2)*/
  
fm_set_rendering(idkRenderFxGlowShellfastrun_glowshell_color_rfastrun_glowshell_color_gfastrun_glowshell_color_bkRenderNormal0)
  
// 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)
 



JoKeR LauGh 08-09-2011 12:08

Re: [zp] nst tank -> zp
 
Quote:

Originally Posted by yokomo (Post 1528094)
Try it.
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"
const fastrun_glowshell_color_r 255
const fastrun_glowshell_color_g 3
const fastrun_glowshell_color_b 0
//new Array:fastrun_fov = 105
const 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_color, 0)
  color[1] = ArrayGetCell(fastrun_glowshell_color, 1)
  color[2] = ArrayGetCell(fastrun_glowshell_color, 2)*/
  
fm_set_rendering(idkRenderFxGlowShellfastrun_glowshell_color_rfastrun_glowshell_color_gfastrun_glowshell_color_bkRenderNormal0)
  
// 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)
 



can't find the function key , wanna set it to G , can help ah? :mrgreen::mrgreen:

bibu 08-09-2011 12:11

Re: [zp] nst tank -> zp
 
Hook drop command then.

yokomo 08-09-2011 12:31

Re: [zp] nst tank -> zp
 
Quote:

Originally Posted by JoKeR LauGh (Post 1528984)
can't find the function key , wanna set it to G , can help ah? :mrgreen::mrgreen:

Already hooked there:
PHP Code:

 register_clcmd("drop""cmd_fastrun"

Default drop button is G

JoKeR LauGh 08-09-2011 18:12

Re: [zp] nst tank -> zp
 
1 Attachment(s)
I don't know why , but when i press 'G' this zombie doesn't sprint ...

I try this one(attachment) , it works fine for me.. but don't have feature like this one (glow , sound etc..)

yokomo 08-11-2011 03:05

Re: [zp] nst tank -> zp
 
1 Attachment(s)
Quote:

Originally Posted by JoKeR LauGh (Post 1529224)
I don't know why , but when i press 'G' this zombie doesn't sprint ...

I try this one(attachment) , it works fine for me.. but don't have feature like this one (glow , sound etc..)

Tested & works fine for me.

JoKeR LauGh 08-11-2011 04:20

Re: [zp] nst tank -> zp
 
Quote:

Originally Posted by yokomo (Post 1530093)
Tested & works fine for me.

So weird ..... i pressed 'G' many time until my g button nearly pissed off .... maybe a bug for me? o.O ... (nearly all my ability zombie in my server using G button...). Check the whole code , but it's fine . I think the code should do bind for the button.
Help , yoko2? :mrgreen:

yokomo 08-11-2011 06:33

Re: [zp] nst tank -> zp
 
Quote:

Originally Posted by JoKeR LauGh (Post 1530127)
So weird ..... i pressed 'G' many time until my g button nearly pissed off .... maybe a bug for me? o.O ... (nearly all my ability zombie in my server using G button...). Check the whole code , but it's fine . I think the code should do bind for the button.
Help , yoko2? :mrgreen:

No matter what button you bind for "drop" command it still work. Just press the button that you bind to drop weapons.

JoKeR LauGh 08-11-2011 11:29

Re: [zp] nst tank -> zp
 
Quote:

Originally Posted by yokomo (Post 1530168)
No matter what button you bind for "drop" command it still work. Just press the button that you bind to drop weapons.

tried to use the "e" button still can't so weird , is this sprinter only for ZP 4.3+ or its for advance?


All times are GMT -4. The time now is 03:18.

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