Errors regarding compiling are fixed and can be found in the rest posts for those interested. Here is the fixed and modified version of nanosuit and it can be used for zombie plague 4.3:
The original plugin that fixes took place,its a good plugin but it lucks from fuctionality due to some problems dealing with zombies , because even the zombies can use the nanosuit modes provided.
[Recommended for zombie plague 4.3] is the first .sma file given thought its updated due to a lot error logs in new linux servers and new hlds engines!
// Buy command public nanosuit_buy(id) { if (cl_nn_has[id] == NANO_YES) { client_print(id,print_center,"#Cstrike_Already_Own_Weapon") return }
if (get_pcvar_num(pcv_nn_price) <= 0) { cl_nn_has[id] = NANO_YES nanosuit_reset(id, true)
return } else { if (get_pcvar_num(pcv_nn_team) != _:cs_get_user_team(id) && get_pcvar_num(pcv_nn_team) != 3) { client_print(id,print_center,"You team is not allowed to buy!") return }
if (get_pcvar_num(pcv_nn_buyzone) && !cs_get_user_buyzone(id)) { client_print(id,print_center,"%L",id,"NANO_BUYZONE") return }
if (get_pcvar_num(pcv_nn_price) <= 0) { cl_nn_has[id] = NANO_YES nanosuit_reset(id, true)
return } else { if (get_pcvar_num(pcv_nn_team) != _:cs_get_user_team(id) && get_pcvar_num(pcv_nn_team) != 3) { client_print(id,print_center,"You team is not allowed to buy!") return }
if (get_pcvar_num(pcv_nn_buyzone) && !cs_get_user_buyzone(id)) { client_print(id,print_center,"%L",id,"NANO_BUYZONE") return }
+1 karma thanks for that zmd thats nice and works.
But now there is another problem that cannot be solved.Im sure or may you zmd remember a plugin published from dare devil and the original one from OT.
There is a case that zombies can use the nanosuit and im thinking may its a major bug that in both versions is not resolved.
This is the case: When you have the nanosuit menu opened as human,and these 4 options appears: Maxium strenth maximum armor maximum speed cloak mode That time you see these options and get infected from a zombie and same time rapidly select one of 4 powers works also for zombies.(may you have 0.2/sec to choose one of those powers as zombie but if you do it rapidly you can use them as zombie.)
i hope i explained it very well.Jut a note! The only nanosuit that i have seen working without that bug is on server named lan-servers from bulgaria but its down.
Best regrds tou zmd94 I can think of only one idea that can be done: The time the human is get infected we can force a menu to appear so it can close the one of nanosuit's that is open so there will be no options for zombie to choose one of those 4 powers.I realy want to solve this and i will post whatever i can think of,i dont have strong coding skills only ideas i can offer.
Last Edit: Apr 16, 2016 16:12:04 GMT by pervade: +++
[Enjoy the life , have fun and be as good as you can in your job's related activities and for sure the path for success is close].
So, you just want the infected human cannot use the nanosuit?
Thanks for reply back so soon!
Yes correct! And just to resume again i want this: I want the nanosuit not to be used from zombies.
The bug happens like this i explain below,just imagine it.
When you are human and you have the nanosuit powers menu opened you see 4 powers: strenth,armor,speed and cloak mode to choose.So in that case you dont choose any power and the menu still remains on screen untill you select one.But if you get infected by a zombie before you choose one of the powers , the menu of powers remains on screen for milliseconds so as zombie you choose rapidly the speed power the zombie will run like horse(very fast).
Conclusion:As human you leave the nanosuit's power menu opened then even you become zombie the nanosuit menu remains opened for some milliseconds and if you rapidly choose a power this works for zombie.[that is problem].
// Viewmodel change on cloak [uncomment to use and recompile] // Do not uncomment these!!! If the weapon model is removed then you will not be allowed to shoot. // It is a big hl engine problem!!! //#define REMOVE_VIEWMODEL_ON_CLOAK //#define USE_WEAPON_STATUSICONS
// Settings defines [here it is a good place to modify some of the settings] // Maxplayers [the max players, change this if you don't have 32 players(Low memory usage)] #define MAXPLAYERS 32
// Energy regeneration multiply if user crouches #define ENERGY_CROUCH 1.2
// Critical border additive so that the plugin will not do the CRITICAL CRITCAL CRITICAL sound [Do not set this to 0.0 or dare!] #define CRITICAL_EXTRA_ADD 10.0
// HIT constant damage multi new const Float:vec_hit_multi[] = { 1.0, 4.0, 1.0, 1.25, 1.0, 1.0, 0.75, 0.75, 0.0 }
new wpn_v_model[CSW_P90 + 1][30] new wpn_v_shield_model[CSW_P90 + 1][50] new wpn_ms_icon[CSW_P90 + 1][14]
// Sounds new const sound_strengh[] = "nanosuit/nanosuit_strength.wav" new const sound_armor[] = "nanosuit/nanosuit_armor.wav" new const sound_speed[] = "nanosuit/nanosuit_speed.wav" new const sound_cloak[] = "nanosuit/nanosuit_cloak.wav" new const sound_energy[] = "nanosuit/nanosuit_energy.wav" new const sound_menu[] = "nanosuit/nanosuit_menu.wav" new const sound_strength_throw[] = "nanosuit/nanosuit_strength_hit.wav" new const sound_strength_jump[] = "nanosuit/nanosuit_strength_jump.wav" new const sound_switch_strength[] = "nanosuit/nanosuit_strength_switch.wav" new const sound_switch_armor[] = "nanosuit/nanosuit_armor_switch.wav" new const sound_switch_speed[] = "nanosuit/nanosuit_speed_switch.wav" new const sound_switch_cloak[] = "nanosuit/nanosuit_cloak_switch.wav" new const sound_speed_run[] = "nanosuit/nanosuit_speed_run.wav"
new const sound_ric_metal1[] = "weapons/ric_metal-1.wav" new const sound_ric_metal2[] = "weapons/ric_metal-2.wav"
// Models new const model_nanosuit_ct[] = "Crysis_US_frk_14" new const model_nanosuit_ctt[] = "Crysis_US_frk_14T" new const model_nanosuit_t[] = "crysis_asian2_frk_14" new const model_nanosuit_tt[] = "crysis_asian2_frk_14T"
// We use this to check if the client said in console model leet for example, we see wether the model is T or not or else we do not set it new vec_model_ct[][] = { "gign", "gsg9", "sas", "urban", "vip" } new vec_model_t[][] = { "arctic", "terror", "leet", "guerilla" }
// Pcvars new pcv_nn_price new pcv_nn_ff new pcv_nn_death new pcv_nn_bot new pcv_nn_bot_buy new pcv_nn_team new pcv_nn_energy new pcv_nn_critical new pcv_nn_health new pcv_nn_armor new pcv_nn_buyzone new pcv_nn_regenerate new pcv_nn_night new pcv_nn_hp_charge new pcv_nn_ap_charge new pcv_nn_ar_speed new pcv_nn_ar_damage new pcv_nn_st_impulse new pcv_nn_st_stab new pcv_nn_st_jump new pcv_nn_st_throw new pcv_nn_st_rec_att new pcv_nn_st_g_throw new pcv_nn_st_rec_en new pcv_nn_st_can_th new pcv_nn_sp_maxim new pcv_nn_sp_ground new pcv_nn_sp_critic new pcv_nn_sp_energy new pcv_nn_sp_reload new pcv_nn_sp_fattack new pcv_nn_sp_fatshre new pcv_nn_cl_energy new pcv_nn_cl_fire new pcv_nn_cl_knife new pcv_nn_cl_grenade new pcv_nn_cl_c4 new pcv_zm_regive
// Plugin info holders new glb_maxplayers new ShadowIdX:SHADOW_CREATE new bool:glb_use_new_models = true
// Client general info new cl_player_model[MAXPLAYERS + 1][32] // player's model name new bool:cl_update_model[MAXPLAYERS + 1] = {false, ...} new cl_nn_weapon[MAXPLAYERS + 1] new bool:cl_is_bot[MAXPLAYERS + 1] = {false, ...} new bool:cl_nn_lowres[MAXPLAYERS + 1] = {false, ...} new NanoStatus:cl_nn_has[MAXPLAYERS + 1] = {NANO_NO, ...} new NanoStatus:cl_nn_had[MAXPLAYERS + 1] = {NANO_NO, ...} new bool:cl_added_velocity[MAXPLAYERS + 1] = {false, ...} new bool:cl_removed_shadow[MAXPLAYERS + 1] = {false, ...} new bool:cl_nn_zombie[MAXPLAYERS + 1] = {false, ...}
// Nanosuit special info new NanoSpdMode:cl_nn_sp_status[MAXPLAYERS + 1] new NanoSpeed:cl_nn_speed[MAXPLAYERS + 1] new NanoSpeedScreen:cl_nn_scr_speed[MAXPLAYERS + 1] new NanoModes:cl_nn_mode[MAXPLAYERS + 1] = {NANO_ARMOR, ...} new Float:cl_nn_energy[MAXPLAYERS + 1] new bool:cl_nn_critical[MAXPLAYERS + 1] new cl_nn_counter[MAXPLAYERS + 1] = {NANO_LOW_RES, ...} new cl_nn_block_recharge[MAXPLAYERS + 1] new KnifeState:cl_nn_st_knife[MAXPLAYERS + 1] = {KNIFE_NOT, ...} new bool:cl_nn_st_jump[MAXPLAYERS + 1] = {false, ...} new cl_is_thrown[MAXPLAYERS + 1] = {0, ...} new Float:cl_nn_punch[MAXPLAYERS + 1][3] new bool:cl_nn_actual_shot[MAXPLAYERS + 1] = {false, ...} new cl_nn_shotgun_ammo[MAXPLAYERS + 1]
// Needs -> hud + menu + monitor + messages new nd_menu[MAXPLAYERS + 1] new nd_hud_sync new nd_ent_monitor new nd_msg_saytext new nd_msg_damage new nd_msg_iconstatus new nd_msg_shadowidx new nd_msg_ammox
new modelpath[100] // We precache the models, if we have problems we don't turn on the model replace system formatex(modelpath, charsmax(modelpath), "models/player/%s/%s.mdl", model_nanosuit_ct, model_nanosuit_ct) if (!file_exists(modelpath)) { glb_use_new_models = false } else { precache_model(modelpath) }
if (!glb_use_new_models) { server_print("[NANO] No models found, not registering the model block forwards!") } else { server_print("[NANO] Models found, activating model block forwards!") register_forward(FM_SetClientKeyValue, "fw_setclientkey") register_event("TeamInfo","event_teaminfo","a") register_forward(FM_ClientUserInfoChanged, "fw_clientuserinfochanged") }
// Ham forwards (yummy) RegisterHam(Ham_CS_RoundRespawn,"player","fw_spawn",1) RegisterHam(Ham_Spawn,"player","fw_spawn",1) RegisterHam(Ham_Killed,"player","fw_killed") RegisterHam(Ham_Player_ResetMaxSpeed,"player","fw_resetmaxspeed",1)
new weapon_name[24]
// Register all weapons for special functions for (new i=CSW_P228;i<=CSW_P90;i++) { if (!(UNREGISTERED_WEAPONS_BITSUM & 1<<i) && get_weaponname(i, weapon_name, charsmax(weapon_name))) { RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_primary_attack") RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_primary_attack_post",1) RegisterHam(Ham_Weapon_SecondaryAttack, weapon_name, "fw_secondary_attack") RegisterHam(Ham_Weapon_SecondaryAttack, weapon_name, "fw_secondary_attack_post",1)
if (!(NO_RELOAD_WEAPONS_BITSUM & (1<<i))) { RegisterHam(Ham_Weapon_Reload, weapon_name, "fw_reload_post", 1) } else { if (i != CSW_KNIFE) { RegisterHam(Ham_Item_Deploy, weapon_name, "fw_shotgun_deploy", 1) RegisterHam(Ham_Weapon_Reload, weapon_name, "fw_special_reload_post", 1) } }
// In the previous function we didn't register the grenades wpn_ms_icon[CSW_HEGRENADE] = "d_grenade" wpn_ms_icon[CSW_FLASHBANG] = "d_grenade" wpn_ms_icon[CSW_SMOKEGRENADE] = "d_grenade"
// Global Stuff glb_maxplayers = global_get(glb_maxClients)
public plugin_init_delay(nr) { // Register the takedamage after 1 second to let the other plugins mess with the variables RegisterHam(Ham_TakeDamage, "player", "fw_takedamage") RegisterHam(Ham_TakeDamage, "player", "fw_takedamage_post", 1) RegisterHam(Ham_TraceAttack, "player", "fw_traceattack")
// Speed fix server_cmd("sv_maxspeed 99999.0") }
public client_putinserver(id) { if (is_user_bot(id)) cl_is_bot[id] = true
if (get_pcvar_num(pcv_nn_price) <= 0) { if (cl_is_bot[id] && get_pcvar_num(pcv_nn_bot)) cl_nn_has[id] = NANO_YES if (!cl_is_bot[id]) cl_nn_has[id] = NANO_YES } else cl_nn_has[id] = NANO_NO }
if (get_pcvar_num(pcv_nn_price) <= 0) { cl_nn_has[id] = NANO_YES nanosuit_reset(id, true)
return } else { if (get_pcvar_num(pcv_nn_team) != _:cs_get_user_team(id) && get_pcvar_num(pcv_nn_team) != 3) { client_print(id,print_center,"You team is not allowed to buy!") return }
if (get_pcvar_num(pcv_nn_buyzone) && !cs_get_user_buyzone(id)) { client_print(id,print_center,"%L",id,"NANO_BUYZONE") return }
public fw_setclientkey(id,const infobuffer[],const key[]) { // Block CS model changes if (cl_nn_has[id] == NANO_YES && equal(key, "model")) return FMRES_SUPERCEDE
return FMRES_IGNORED }
public fw_clientuserinfochanged(id) { if (!is_user_connected(id)) return FMRES_IGNORED
// Get current model new currentmodel[32] fm_get_user_model(id, currentmodel, charsmax(currentmodel))
// Check whether it matches the custom model - if not, set it again if (!equal(currentmodel, cl_player_model[id])) { if (cl_nn_has[id] == NANO_YES) { switch (cs_get_user_team(id)) { case CS_TEAM_CT: { for (new i=0;i<5;i++) { if (equali(currentmodel,vec_model_ct[i])) { cl_update_model[id] = true copy(cl_player_model[id], 31, currentmodel) return FMRES_SUPERCEDE } } } case CS_TEAM_T: { for (new i=0;i<4;i++) { if (equali(currentmodel,vec_model_t[i])) { cl_update_model[id] = true copy(cl_player_model[id], 31, currentmodel) return FMRES_SUPERCEDE } } } } } else { switch (cs_get_user_team(id)) { case CS_TEAM_CT: { for (new i=0;i<5;i++) { if (equali(currentmodel,vec_model_ct[i])) { fm_set_user_model(id,currentmodel) return FMRES_SUPERCEDE } }
fm_reset_user_model(id) } case CS_TEAM_T: { for (new i=0;i<4;i++) { if (equali(currentmodel,vec_model_t[i])) { fm_set_user_model(id,currentmodel) return FMRES_SUPERCEDE } }
if (cl_nn_mode[id] == NANO_CLOAK) { if (cl_nn_weapon[id] == CSW_KNIFE && get_pcvar_num(pcv_nn_cl_knife)) { set_nano_energy(id,0.0,DELAY_CLK_FORCED) return HAM_IGNORED } }
return HAM_IGNORED }
public fw_secondary_attack_post(ent) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX)
if (cl_nn_has[id] == NANO_YES && cl_nn_mode[id] == NANO_SPEED && cl_nn_energy[id] >= get_pcvar_float(pcv_nn_critical)) { new Float:multi = 1.0 switch (cl_nn_weapon[id]) { case CSW_KNIFE: { multi = REFIRE_KNIFE new Float:mdelay mdelay = get_pdata_float( ent, OFFSET_WEAPON_NEXT_SEC_ATTACK, EXTRA_OFFSET_WEAPON_LINUX) * multi set_pdata_float( ent, OFFSET_WEAPON_NEXT_SEC_ATTACK, mdelay, EXTRA_OFFSET_WEAPON_LINUX) } } if (multi != 1.0) set_nano_energy(id, cl_nn_energy[id] - get_pcvar_float(pcv_nn_sp_fattack),DELAY_SPD_FAST_ATTACK)
new Float:delay delay = get_pdata_float( ent, OFFSET_WEAPON_NEXT_PRIMARY_ATTACK, EXTRA_OFFSET_WEAPON_LINUX) * multi set_pdata_float( ent, OFFSET_WEAPON_NEXT_PRIMARY_ATTACK, delay, EXTRA_OFFSET_WEAPON_LINUX) } return HAM_IGNORED }
public fw_shotgun_deploy(ent) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX) cl_nn_shotgun_ammo[id] = cs_get_weapon_ammo(ent) }
public fw_special_reload_post(ent) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX)
new wpn_id = cs_get_weapon_id(ent) new maxammo = wpn_max_clip[wpn_id] new curammo = cs_get_weapon_ammo(ent)
// Update hud weapon info, emessage to be blocked if needed emessage_begin(MSG_ONE, nd_msg_ammox, {0,0,0}, id) ewrite_byte(SH_AMMO_MSG_AMMOID) ewrite_byte(curammo + 1) emessage_end()
} }
return HAM_IGNORED
}
public fw_reload_post(ent) { if(get_pdata_int(ent, OFFSET_WEAPON_IN_RELOAD, EXTRA_OFFSET_WEAPON_LINUX)) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX)
public fw_killed(id,attacker,gib) { if (cl_nn_has[id] == NANO_YES) { msg_statusicon(id,ICON_REMOVE,NanoStatusIcon[cl_nn_mode[id]],NanoScreenColor[cl_nn_mode[id]]) #if defined USE_WEAPON_STATUSICONS msg_statusicon(id,ICON_REMOVE,wpn_ms_icon[cl_nn_weapon[id]],{0,255,0}) #endif }
return HAM_IGNORED }
public fw_traceattack(victim, attacker, Float:damage, Float:direction[3], tr, damagebits) { new hitzone hitzone = get_tr2(tr,TR_iHitgroup) damage *= vec_hit_multi[hitzone] new Float:origin[3] pev(attacker,pev_origin,origin) new use_strength use_strength = 0
if (is_user_player(attacker)) { // Strength Mode if (get_pcvar_num(pcv_nn_ff)) { if (cs_get_user_team(victim) == cs_get_user_team(attacker)) { damage /= 2.0 use_strength = 2 } else { use_strength = 1 } } else { if (cs_get_user_team(victim) == cs_get_user_team(attacker)) { if (get_pcvar_num(pcv_nn_st_can_th)) use_strength = 1 } else { use_strength = 1 } }
if (cl_nn_st_knife[attacker] == KNIFE_FIRST_ATTACK) { new Float:origin[3], Float:origin2[3], Float:throw[3], Float:aimvel[3]
// Get the origin of attacker and victim pev(victim,pev_origin,origin) pev(attacker,pev_origin,origin2) velocity_by_aim(attacker,2,aimvel)
// We need to make a vector between them and we multiply it's value so we can make it powerfull xs_vec_sub(origin,origin2,throw) xs_vec_div_scalar(throw,xs_vec_len(throw),throw) xs_vec_add(throw,aimvel,throw) xs_vec_div_scalar(throw,xs_vec_len(throw),throw) throw[2] += 0.6 xs_vec_mul_scalar(throw,get_pcvar_float(pcv_nn_st_throw),throw)
// We add it to the velocity so we can make it a throw set_pev(victim,pev_velocity,throw)
// We block the speed of the player so he can't influence the direction of the throw (too much :P) set_user_maxspeed(victim, 1.0) cl_is_thrown[victim] = attacker set_pev(victim,pev_flags,pev(victim,pev_flags) & ~FL_ONGROUND) }
/* =================================================== [Screen think of all players] ==================================================== */ public fw_screenthink(ent) { if (!pev_valid(ent)) return FMRES_IGNORED
if (ent != nd_ent_monitor) return FMRES_IGNORED
new players[32], count, id new Float:energy energy = get_pcvar_float(pcv_nn_energy)
get_players(players, count, "ac")
for (new i=0;i<count;i++) { id = players[i]
if (cl_nn_has[id] == NANO_YES && ((cl_nn_lowres[id] && cl_nn_counter[id] == 0) || !cl_nn_lowres[id])) { // Current Mode static hud[200]
formatex(hud, 199, "%L",id,"NANO_MODE")
switch (cl_nn_mode[id]) { case NANO_STREN: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_ST_MODE") case NANO_ARMOR: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_A_MODE") case NANO_SPEED: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_S_MODE") case NANO_CLOAK: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_C_MODE") }
formatex(hud, 199, "%L",id,"NANO_ENERGY", hud, floatround(cl_nn_energy[id] / energy * 100))
for (new x = 0; x < floatround(cl_nn_energy[id] / energy * 20); x++) formatex(hud, 199, "%s|", hud)
if (!is_user_alive(id)) { return PLUGIN_CONTINUE }
new NanoModes:active = cl_nn_mode[id] new Float:energy = cl_nn_energy[id]
// Decrease when player is running in speed mode if (active == NANO_SPEED && pev(id,pev_flags) & ON_LAND_CONST) { new Float:multi
switch (cl_nn_sp_status[id]) { case SPEED_NORMAL: { switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.0 case SPD_VSLOW: multi = 0.0 case SPD_SLOW: multi = 0.0 case SPD_NORMAL: multi = 1.0 case SPD_FAST: multi = 1.0 }
energy -= (0.1) * multi } case SPEED_CRITICAL: { switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.0 case SPD_VSLOW: multi = 0.0 case SPD_SLOW: multi = 0.0 case SPD_NORMAL: multi = 0.0 case SPD_FAST: multi = 1.0 }
energy -= (0.2) * multi } case SPEED_MAXIMUM: { switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.0 case SPD_VSLOW: multi = 0.0 case SPD_SLOW: multi = 0.0 case SPD_NORMAL: multi = 0.0 case SPD_FAST: { multi = 1.0 client_cmd(id, "speak %s", sound_speed_run) } }
energy -= get_pcvar_float(pcv_nn_sp_energy) * multi } }
if (multi != 0.0) cl_nn_block_recharge[id] = DELAY_SPD_RUN + 1 }
// Decrease in cloak mode if (active == NANO_CLOAK) { static Float:multi = 1.0
switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.1 case SPD_VSLOW: multi = 0.2 case SPD_SLOW: multi = 0.5 case SPD_NORMAL: multi = 1.0 case SPD_FAST: multi = 1.4 }
energy -= get_pcvar_float(pcv_nn_cl_energy) * multi }
if (energy < get_pcvar_num(pcv_nn_critical) && !cl_nn_critical[id]) { cl_nn_critical[id] = true
// Useful to block the moment when a player energy is bigger than the maximum energy energy = floatmin(get_pcvar_float(pcv_nn_energy), energy2)
if (energy > get_pcvar_float(pcv_nn_critical) + CRITICAL_EXTRA_ADD) cl_nn_critical[id] = false }
if (cl_nn_block_recharge[id] > 0) cl_nn_block_recharge[id] -= 1
cl_nn_energy[id] = energy
return PLUGIN_CONTINUE }
/* =================================================== [Armor and HitPoints nano recharge] ==================================================== */ public nanosuit_ah_charge(id) { id -= TASK_AH_REC
/* =================================================== [Bot think task, allows bots to use the nano functions] ==================================================== */ public nanosuit_bot_think(id) { id -= TASK_AI
if (!is_user_alive(id)) return PLUGIN_CONTINUE
if (!cl_is_bot[id]) { remove_task(id + TASK_AI) return PLUGIN_CONTINUE }
new Float:health pev(id,pev_health,health)
if (health < 60.0) { nanosuit_menu_choose(id,0,_:NANO_ARMOR) return PLUGIN_CONTINUE }
new hit = -1 new Float:origin[3] pev(id,pev_origin,origin) new Float:velocity[3] pev(id,pev_velocity,velocity) vector_length(velocity)
public zp_user_humanized_post(id, survivor) { if (!get_pcvar_num(pcv_zm_regive)) return PLUGIN_CONTINUE
if (cl_nn_had[id] == NANO_YES) { cl_nn_has[id] = NANO_YES nanosuit_reset(id) }
return PLUGIN_CONTINUE }
/* =================================================== [Functions that come in handy] ==================================================== */ set_nano_mode(id, NanoModes:mode, bool:announce = true) { if (cl_nn_mode[id] == mode) return
if (cl_nn_mode[id] == NANO_CLOAK) { #if defined REMOVE_VIEWMODEL_ON_CLOAK if (!cl_is_bot[id]) { if (cs_get_user_shield(id) && (WEAPONS_WITH_SHIELD_BITSUM & 1<<cl_nn_weapon[id])) { set_pev(id,pev_viewmodel2,wpn_v_shield_model[cl_nn_weapon[id]]) } else set_pev(id,pev_viewmodel2,wpn_v_model[cl_nn_weapon[id]]) } #endif #if defined USE_WEAPON_STATUSICONS msg_statusicon(id,ICON_REMOVE,wpn_ms_icon[cl_nn_weapon[id]],{0,0,0}) #endif
msg_shadowidx(id,SHADOW_CREATE) } if (mode == NANO_CLOAK) { msg_shadowidx(id,SHADOW_REMOVE) }
public fm_set_user_model(player,const model[]) { // Set new model engfunc(EngFunc_SetClientKeyValue, player, engfunc( EngFunc_GetInfoKeyBuffer, player ), "model", model) }
Personal message only for paid request. If you love this forum, kindly to donate by clicking the donate button at the footer of this forum.
// Settings defines [here it is a good place to modify some of the settings] // Maxplayers [the max players, change this if you don't have 32 players(Low memory usage)] #define MAXPLAYERS 32
// Energy regeneration multiply if user crouches #define ENERGY_CROUCH 1.2
// Critical border additive so that the plugin will not do the CRITICAL CRITCAL CRITICAL sound [Do not set this to 0.0 or dare!] #define CRITICAL_EXTRA_ADD 10.0
// HIT constant damage multi new const Float:vec_hit_multi[] = { 1.0, 4.0, 1.0, 1.25, 1.0, 1.0, 0.75, 0.75, 0.0 }
new wpn_v_model[CSW_P90 + 1][30] new wpn_v_shield_model[CSW_P90 + 1][50] new wpn_ms_icon[CSW_P90 + 1][14]
// Sounds new const sound_strengh[] = "zp_nanosuit/nanosuit_strength.wav" new const sound_online[] = "zp_nanosuit/nanosuit_allonline.wav" new const sound_armor[] = "zp_nanosuit/nanosuit_armor.wav" new const sound_speed[] = "zp_nanosuit/nanosuit_speed.wav" new const sound_cloak[] = "zp_nanosuit/nanosuit_cloak.wav" new const sound_energy[] = "zp_nanosuit/nanosuit_energy.wav" new const sound_menu[] = "zp_nanosuit/nanosuit_menu.wav" new const sound_strength_throw[] = "zp_nanosuit/nanosuit_strength_hit.wav" new const sound_switch_strength[] = "zp_nanosuit/nanosuit_strength_switch.wav" new const sound_switch_armor[] = "zp_nanosuit/nanosuit_armor_switch.wav" new const sound_switch_speed[] = "zp_nanosuit/nanosuit_speed_switch.wav" new const sound_switch_cloak[] = "zp_nanosuit/nanosuit_cloak_switch.wav" new const sound_speed_run[] = "zp_nanosuit/nanosuit_speed_run.wav"
new const sound_ric_metal1[] = "weapons/ric_metal-1.wav" new const sound_ric_metal2[] = "weapons/ric_metal-2.wav"
// We use this to check if the client said in console model leet for example, we see wether the model is T or not or else we do not set it new vec_model_ct[][] = { "gign", "gsg9", "sas", "urban", "vip" } new vec_model_t[][] = { "arctic", "terror", "leet", "guerilla" }
// Pcvars new pcv_nn_price new pcv_nn_ff new pcv_nn_death new pcv_nn_bot new pcv_nn_bot_buy new pcv_nn_team new pcv_nn_energy new pcv_nn_critical new pcv_nn_health new pcv_nn_buyzone new pcv_nn_regenerate new pcv_nn_night new pcv_nn_hp_charge new pcv_nn_ar_speed new pcv_nn_ar_damage new pcv_nn_st_stab new pcv_nn_st_throw new pcv_nn_st_rec_att new pcv_nn_st_g_throw new pcv_nn_st_rec_en new pcv_nn_st_can_th new pcv_nn_sp_maxim new pcv_nn_sp_ground new pcv_nn_sp_critic new pcv_nn_sp_energy new pcv_nn_sp_reload new pcv_nn_sp_fattack new pcv_nn_sp_fatshre new pcv_nn_cl_energy new pcv_nn_cl_fire new pcv_nn_cl_knife new pcv_nn_cl_grenade new pcv_nn_cl_c4 new pcv_zm_regive
new g_msgScreenFade
// Plugin info holders new glb_maxplayers new ShadowIdX:SHADOW_CREATE new bool:glb_use_new_models = true
// Client general info new cl_player_model[MAXPLAYERS + 1][32] // player's model name new bool:cl_update_model[MAXPLAYERS + 1] = {false, ...} new cl_nn_weapon[MAXPLAYERS + 1] new bool:cl_is_bot[MAXPLAYERS + 1] = {false, ...} new bool:cl_nn_lowres[MAXPLAYERS + 1] = {false, ...} new NanoStatus:cl_nn_has[MAXPLAYERS + 1] = {NANO_NO, ...} new NanoStatus:cl_nn_had[MAXPLAYERS + 1] = {NANO_NO, ...} new bool:cl_added_velocity[MAXPLAYERS + 1] = {false, ...} new bool:cl_removed_shadow[MAXPLAYERS + 1] = {false, ...} new bool:cl_nn_zombie[MAXPLAYERS + 1] = {false, ...}
// Nanosuit special info new NanoSpdMode:cl_nn_sp_status[MAXPLAYERS + 1] new NanoSpeed:cl_nn_speed[MAXPLAYERS + 1] new NanoSpeedScreen:cl_nn_scr_speed[MAXPLAYERS + 1] new NanoModes:cl_nn_mode[MAXPLAYERS + 1] = {NANO_ARMOR, ...} new Float:cl_nn_energy[MAXPLAYERS + 1] new bool:cl_nn_critical[MAXPLAYERS + 1] new bool:cl_nn_online[MAXPLAYERS + 1] new cl_nn_counter[MAXPLAYERS + 1] = {NANO_LOW_RES, ...} new cl_nn_block_recharge[MAXPLAYERS + 1] new KnifeState:cl_nn_st_knife[MAXPLAYERS + 1] = {KNIFE_NOT, ...} new cl_is_thrown[MAXPLAYERS + 1] = {0, ...} new Float:cl_nn_punch[MAXPLAYERS + 1][3] new bool:cl_nn_actual_shot[MAXPLAYERS + 1] = {false, ...} new cl_nn_shotgun_ammo[MAXPLAYERS + 1]
// Needs -> hud + menu + monitor + messages new nd_menu[MAXPLAYERS + 1] new nd_hud_sync new nd_ent_monitor new nd_msg_saytext new nd_msg_damage new nd_msg_iconstatus new nd_msg_shadowidx new nd_msg_ammox
if (!glb_use_new_models) { server_print("[NANO] No models found, not registering the model block forwards!") } else { server_print("[NANO] Models found, activating model block forwards!") register_forward(FM_SetClientKeyValue, "fw_setclientkey") register_event("TeamInfo","event_teaminfo","a") register_forward(FM_ClientUserInfoChanged, "fw_clientuserinfochanged") }
// Ham forwards (yummy) RegisterHam(Ham_CS_RoundRespawn,"player","fw_spawn",1) RegisterHam(Ham_Spawn,"player","fw_spawn",1) RegisterHam(Ham_Killed,"player","fw_killed") RegisterHam(Ham_Player_ResetMaxSpeed,"player","fw_resetmaxspeed",1)
new weapon_name[24]
// Register all weapons for special functions for (new i=CSW_P228;i<=CSW_P90;i++) { if (!(UNREGISTERED_WEAPONS_BITSUM & 1<<i) && get_weaponname(i, weapon_name, charsmax(weapon_name))) { RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_primary_attack") RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_primary_attack_post",1) RegisterHam(Ham_Weapon_SecondaryAttack, weapon_name, "fw_secondary_attack") RegisterHam(Ham_Weapon_SecondaryAttack, weapon_name, "fw_secondary_attack_post",1)
if (!(NO_RELOAD_WEAPONS_BITSUM & (1<<i))) { RegisterHam(Ham_Weapon_Reload, weapon_name, "fw_reload_post", 1) } else { if (i != CSW_KNIFE) { RegisterHam(Ham_Item_Deploy, weapon_name, "fw_shotgun_deploy", 1) RegisterHam(Ham_Weapon_Reload, weapon_name, "fw_special_reload_post", 1) } }
// In the previous function we didn't register the grenades wpn_ms_icon[CSW_HEGRENADE] = "d_grenade" wpn_ms_icon[CSW_FLASHBANG] = "d_grenade" wpn_ms_icon[CSW_SMOKEGRENADE] = "d_grenade"
// Global Stuff glb_maxplayers = global_get(glb_maxClients)
public plugin_init_delay(nr) { // Register the takedamage after 1 second to let the other plugins mess with the variables RegisterHam(Ham_TakeDamage, "player", "fw_takedamage") RegisterHam(Ham_TakeDamage, "player", "fw_takedamage_post", 1) RegisterHam(Ham_TraceAttack, "player", "fw_traceattack")
// Speed fix server_cmd("sv_maxspeed 99999.0") }
public client_putinserver(id) { if (is_user_bot(id)) cl_is_bot[id] = true
if (get_pcvar_num(pcv_nn_price) <= 0) { if (cl_is_bot[id] && get_pcvar_num(pcv_nn_bot)) cl_nn_has[id] = NANO_YES if (!cl_is_bot[id]) cl_nn_has[id] = NANO_YES } else cl_nn_has[id] = NANO_NO }
if (item != -3 && cl_nn_mode[id] != NanoModes:item) { if (cl_nn_mode[id] == NANO_SPEED) { if (cl_nn_energy[id] > get_pcvar_float(pcv_nn_critical)) cl_nn_sp_status[id] = SPEED_MAXIMUM if (get_pcvar_float(pcv_nn_critical) >= cl_nn_energy[id] > 0) cl_nn_sp_status[id] = SPEED_CRITICAL if (0 >= cl_nn_energy[id]) cl_nn_sp_status[id] = SPEED_NORMAL
switch (cl_nn_sp_status[id]) { case SPEED_MAXIMUM: set_user_maxspeed(id,get_user_maxspeed(id) / get_pcvar_float(pcv_nn_sp_maxim)) case SPEED_CRITICAL: set_user_maxspeed(id,get_user_maxspeed(id) / get_pcvar_float(pcv_nn_sp_critic)) } }
if (NanoModes:item == NANO_SPEED) { if (cl_nn_energy[id] > get_pcvar_float(pcv_nn_critical)) cl_nn_sp_status[id] = SPEED_MAXIMUM if (get_pcvar_float(pcv_nn_critical) >= cl_nn_energy[id] > 0) cl_nn_sp_status[id] = SPEED_CRITICAL if (0 >= cl_nn_energy[id]) cl_nn_sp_status[id] = SPEED_NORMAL
switch (cl_nn_sp_status[id]) { case SPEED_MAXIMUM: set_user_maxspeed(id,get_user_maxspeed(id) * get_pcvar_float(pcv_nn_sp_maxim)) case SPEED_CRITICAL: set_user_maxspeed(id,get_user_maxspeed(id) * get_pcvar_float(pcv_nn_sp_critic)) } }
set_nano_mode(id,NanoModes:item) }
if (menu != 0) menu_destroy(nd_menu[id]) return PLUGIN_HANDLED }
// Buy command public nanosuit_buy(id) { if (cl_nn_has[id] == NANO_YES) { client_print(id,print_center,"#Cstrike_Already_Own_Weapon") return }
if (get_pcvar_num(pcv_nn_price) <= 0) { cl_nn_has[id] = NANO_YES nanosuit_reset(id, true)
return } else { if (get_pcvar_num(pcv_nn_team) != _:cs_get_user_team(id) && get_pcvar_num(pcv_nn_team) != 3) { client_print(id,print_center,"You team is not allowed to buy!") return }
if (get_pcvar_num(pcv_nn_buyzone) && !cs_get_user_buyzone(id)) { client_print(id,print_center,"%L",id,"NANO_BUYZONE") return }
public fw_setclientkey(id,const infobuffer[],const key[]) { // Block CS model changes if (cl_nn_has[id] == NANO_YES && equal(key, "model")) return FMRES_SUPERCEDE
return FMRES_IGNORED }
public fw_clientuserinfochanged(id) { if (!is_user_connected(id)) return FMRES_IGNORED
// Get current model new currentmodel[32] fm_get_user_model(id, currentmodel, charsmax(currentmodel))
// Check whether it matches the custom model - if not, set it again if (!equal(currentmodel, cl_player_model[id])) { if (cl_nn_has[id] == NANO_YES) { switch (cs_get_user_team(id)) { case CS_TEAM_CT: { for (new i=0;i<5;i++) { if (equali(currentmodel,vec_model_ct[i])) { cl_update_model[id] = true copy(cl_player_model[id], 31, currentmodel) return FMRES_SUPERCEDE } } } case CS_TEAM_T: { for (new i=0;i<4;i++) { if (equali(currentmodel,vec_model_t[i])) { cl_update_model[id] = true copy(cl_player_model[id], 31, currentmodel) return FMRES_SUPERCEDE } } } } } else { switch (cs_get_user_team(id)) { case CS_TEAM_CT: { for (new i=0;i<5;i++) { if (equali(currentmodel,vec_model_ct[i])) { fm_set_user_model(id,currentmodel) return FMRES_SUPERCEDE } }
fm_reset_user_model(id) } case CS_TEAM_T: { for (new i=0;i<4;i++) { if (equali(currentmodel,vec_model_t[i])) { fm_set_user_model(id,currentmodel) return FMRES_SUPERCEDE } }
if (cl_nn_mode[id] == NANO_CLOAK) { if (cl_nn_weapon[id] == CSW_KNIFE && get_pcvar_num(pcv_nn_cl_knife)) { set_nano_energy(id,0.0,DELAY_CLK_FORCED) return HAM_IGNORED } }
return HAM_IGNORED }
public fw_secondary_attack_post(ent) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX)
if (cl_nn_has[id] == NANO_YES && cl_nn_mode[id] == NANO_SPEED && cl_nn_energy[id] >= get_pcvar_float(pcv_nn_critical)) { new Float:multi = 1.0 switch (cl_nn_weapon[id]) { case CSW_KNIFE: { multi = REFIRE_KNIFE new Float:mdelay mdelay = get_pdata_float( ent, OFFSET_WEAPON_NEXT_SEC_ATTACK, EXTRA_OFFSET_WEAPON_LINUX) * multi set_pdata_float( ent, OFFSET_WEAPON_NEXT_SEC_ATTACK, mdelay, EXTRA_OFFSET_WEAPON_LINUX) } } if (multi != 1.0) set_nano_energy(id, cl_nn_energy[id] - get_pcvar_float(pcv_nn_sp_fattack),DELAY_SPD_FAST_ATTACK)
new Float:delay delay = get_pdata_float( ent, OFFSET_WEAPON_NEXT_PRIMARY_ATTACK, EXTRA_OFFSET_WEAPON_LINUX) * multi set_pdata_float( ent, OFFSET_WEAPON_NEXT_PRIMARY_ATTACK, delay, EXTRA_OFFSET_WEAPON_LINUX) } return HAM_IGNORED }
public fw_shotgun_deploy(ent) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX) cl_nn_shotgun_ammo[id] = cs_get_weapon_ammo(ent) }
public fw_special_reload_post(ent) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX)
new wpn_id = cs_get_weapon_id(ent) new maxammo = wpn_max_clip[wpn_id] new curammo = cs_get_weapon_ammo(ent)
// Update hud weapon info, emessage to be blocked if needed emessage_begin(MSG_ONE, nd_msg_ammox, {0,0,0}, id) ewrite_byte(SH_AMMO_MSG_AMMOID) ewrite_byte(curammo + 1) emessage_end()
} }
return HAM_IGNORED
}
public fw_reload_post(ent) { if(get_pdata_int(ent, OFFSET_WEAPON_IN_RELOAD, EXTRA_OFFSET_WEAPON_LINUX)) { new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, EXTRA_OFFSET_WEAPON_LINUX)
public fw_killed(id,attacker,gib) { if (cl_nn_has[id] == NANO_YES) { msg_statusicon(id,ICON_REMOVE,NanoStatusIcon[cl_nn_mode[id]],NanoScreenColor[cl_nn_mode[id]]) #if defined USE_WEAPON_STATUSICONS msg_statusicon(id,ICON_REMOVE,wpn_ms_icon[cl_nn_weapon[id]],{0,255,0}) #endif }
return HAM_IGNORED }
public fw_traceattack(victim, attacker, Float:damage, Float:direction[3], tr, damagebits) { new hitzone hitzone = get_tr2(tr,TR_iHitgroup) damage *= vec_hit_multi[hitzone] new Float:origin[3] pev(attacker,pev_origin,origin) new use_strength use_strength = 0
if (is_user_player(attacker)) { // Strength Mode if (get_pcvar_num(pcv_nn_ff)) { if (cs_get_user_team(victim) == cs_get_user_team(attacker)) { damage /= 2.0 use_strength = 2 } else { use_strength = 1 } } else { if (cs_get_user_team(victim) == cs_get_user_team(attacker)) { if (get_pcvar_num(pcv_nn_st_can_th)) use_strength = 1 } else { use_strength = 1 } }
if (cl_nn_st_knife[attacker] == KNIFE_FIRST_ATTACK) { new Float:origin[3], Float:origin2[3], Float:throw[3], Float:aimvel[3]
// Get the origin of attacker and victim pev(victim,pev_origin,origin) pev(attacker,pev_origin,origin2) velocity_by_aim(attacker,2,aimvel)
// We need to make a vector between them and we multiply it's value so we can make it powerfull xs_vec_sub(origin,origin2,throw) xs_vec_div_scalar(throw,xs_vec_len(throw),throw) xs_vec_add(throw,aimvel,throw) xs_vec_div_scalar(throw,xs_vec_len(throw),throw) throw[2] += 0.6 xs_vec_mul_scalar(throw,get_pcvar_float(pcv_nn_st_throw),throw)
// We add it to the velocity so we can make it a throw set_pev(victim,pev_velocity,throw)
// We block the speed of the player so he can't influence the direction of the throw (too much :P) set_user_maxspeed(victim, 1.0) cl_is_thrown[victim] = attacker set_pev(victim,pev_flags,pev(victim,pev_flags) & ~FL_ONGROUND) }
/* =================================================== [Screen think of all players] ==================================================== */ public fw_screenthink(ent) { if (!pev_valid(ent)) return FMRES_IGNORED
if (ent != nd_ent_monitor) return FMRES_IGNORED
new players[32], count, id new Float:energy energy = get_pcvar_float(pcv_nn_energy)
get_players(players, count, "ac")
for (new i=0;i<count;i++) { id = players[i]
if (cl_nn_has[id] == NANO_YES && ((cl_nn_lowres[id] && cl_nn_counter[id] == 0) || !cl_nn_lowres[id])) { // Current Mode static hud[200]
formatex(hud, 199, "%L",id,"NANO_MODE")
switch (cl_nn_mode[id]) { case NANO_STREN: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_ST_MODE") case NANO_ARMOR: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_A_MODE") case NANO_SPEED: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_S_MODE") case NANO_CLOAK: formatex(hud, 199, "%s %L ^n",hud,id,"NANO_C_MODE") }
formatex(hud, 199, "%L",id,"NANO_ENERGY", hud, floatround(cl_nn_energy[id] / energy * 100))
for (new x = 0; x < floatround(cl_nn_energy[id] / energy * 20); x++) formatex(hud, 199, "%s|", hud)
if (!is_user_alive(id)) { return PLUGIN_CONTINUE }
new NanoModes:active = cl_nn_mode[id] new Float:energy = cl_nn_energy[id]
// Decrease when player is running in speed mode if (active == NANO_SPEED && pev(id,pev_flags) & ON_LAND_CONST) { new Float:multi
switch (cl_nn_sp_status[id]) { case SPEED_NORMAL: { switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.0 case SPD_VSLOW: multi = 0.0 case SPD_SLOW: multi = 0.0 case SPD_NORMAL: multi = 1.0 case SPD_FAST: multi = 1.0 }
energy -= (0.1) * multi } case SPEED_CRITICAL: { switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.0 case SPD_VSLOW: multi = 0.0 case SPD_SLOW: multi = 0.0 case SPD_NORMAL: multi = 0.0 case SPD_FAST: multi = 1.0 }
energy -= (0.2) * multi } case SPEED_MAXIMUM: { switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.0 case SPD_VSLOW: multi = 0.0 case SPD_SLOW: multi = 0.0 case SPD_NORMAL: multi = 0.0 case SPD_FAST: { multi = 1.0 client_cmd(id, "speak %s", sound_speed_run) } }
energy -= get_pcvar_float(pcv_nn_sp_energy) * multi } }
if (multi != 0.0) cl_nn_block_recharge[id] = DELAY_SPD_RUN + 1 }
// Decrease in cloak mode if (active == NANO_CLOAK) { static Float:multi = 1.0
switch (cl_nn_speed[id]) { case SPD_STILL: multi = 0.1 case SPD_VSLOW: multi = 0.2 case SPD_SLOW: multi = 0.5 case SPD_NORMAL: multi = 1.0 case SPD_FAST: multi = 1.4 }
energy -= get_pcvar_float(pcv_nn_cl_energy) * multi }
// Useful to block the moment when a player energy is bigger than the maximum energy energy = floatmin(get_pcvar_float(pcv_nn_energy), energy2)
if (energy > get_pcvar_float(pcv_nn_critical) + CRITICAL_EXTRA_ADD) cl_nn_critical[id] = false } // White if (cl_nn_has[id] == NANO_YES && cl_nn_mode[id] == NANO_CLOAK) { message_begin(MSG_ONE, g_msgScreenFade, _, id) write_short((1<<12)*2) // duration write_short(0) // hold time write_short(0x0000) // fade type write_byte(200) // r write_byte(200) // g write_byte(200) // b write_byte(70) // nvg Alpha message_end() }
if (cl_nn_block_recharge[id] > 0) cl_nn_block_recharge[id] -= 1
cl_nn_energy[id] = energy
return PLUGIN_CONTINUE }
/* =================================================== [Armor and HitPoints nano recharge] ==================================================== */ public nanosuit_ah_charge(id) { id -= TASK_AH_REC
cl_nn_sp_status[id] = SPEED_CRITICAL } if (0 >= cl_nn_energy[id]) { if (cl_nn_sp_status[id] == SPEED_MAXIMUM) { set_user_maxspeed(id,get_user_maxspeed(id) / get_pcvar_float(pcv_nn_sp_maxim)) } if (cl_nn_sp_status[id] == SPEED_CRITICAL) { set_user_maxspeed(id,get_user_maxspeed(id) / get_pcvar_float(pcv_nn_sp_critic)) }
cl_nn_sp_status[id] = SPEED_NORMAL }
return }
if (cl_nn_mode[id] == NANO_STREN) set_pev(id, pev_fuser2, 0.0)
if (!is_glowing_in_nano(id)) { set_nano_glow(id) }
return }
/* =================================================== [Bot think task, allows bots to use the nano functions] ==================================================== */ public nanosuit_bot_think(id) { id -= TASK_AI
if (!is_user_alive(id)) return PLUGIN_CONTINUE
if (!cl_is_bot[id]) { remove_task(id + TASK_AI) return PLUGIN_CONTINUE }
new Float:health pev(id,pev_health,health)
if (health < 60.0) { nanosuit_menu_choose(id,0,_:NANO_ARMOR) return PLUGIN_CONTINUE }
new hit = -1 new Float:origin[3] pev(id,pev_origin,origin) new Float:velocity[3] pev(id,pev_velocity,velocity) vector_length(velocity)
/* =================================================== [Functions that come in handy] ==================================================== */ set_nano_mode(id, NanoModes:mode, bool:announce = true) { if (cl_nn_mode[id] == mode) return
if (cl_nn_mode[id] == NANO_CLOAK) { #if defined REMOVE_VIEWMODEL_ON_CLOAK if (!cl_is_bot[id]) { if (cs_get_user_shield(id) && (WEAPONS_WITH_SHIELD_BITSUM & 1<<cl_nn_weapon[id])) { set_pev(id,pev_viewmodel2,wpn_v_shield_model[cl_nn_weapon[id]]) } else set_pev(id,pev_viewmodel2,wpn_v_model[cl_nn_weapon[id]]) } #endif #if defined USE_WEAPON_STATUSICONS msg_statusicon(id,ICON_REMOVE,wpn_ms_icon[cl_nn_weapon[id]],{0,0,0}) #endif
msg_shadowidx(id,SHADOW_CREATE) } if (mode == NANO_CLOAK) { msg_shadowidx(id,SHADOW_REMOVE) }
if (affect_user_properties) { if (!zp_get_user_zombie(id)) { cl_nn_energy[id] = get_pcvar_float(pcv_nn_energy) set_user_health(id, get_pcvar_num(pcv_nn_health)) if (get_pcvar_num(pcv_nn_night)) cs_set_user_nvg(id,1) }
if (cl_nn_mode[id] == NANO_SPEED) { switch (cl_nn_sp_status[id]) { case SPEED_MAXIMUM: set_user_maxspeed(id,get_user_maxspeed(id) * get_pcvar_float(pcv_nn_sp_maxim)) case SPEED_CRITICAL: set_user_maxspeed(id,get_user_maxspeed(id) * get_pcvar_float(pcv_nn_sp_critic)) } } }
if (task_exists(id + TASK_ENERGY)) remove_task(id + TASK_ENERGY)
if (task_exists(id + TASK_AH_REC)) remove_task(id + TASK_AH_REC)
if (task_exists(id + TASK_AI)) remove_task(id + TASK_AI)
public fm_set_user_model(player,const model[]) { // Set new model engfunc(EngFunc_SetClientKeyValue, player, engfunc( EngFunc_GetInfoKeyBuffer, player ), "model", model) }
Interested in playing Zombie Plague / Escape servers. If somebody wants to play , PM me with IP
Just try mine plugin and his (first his then mine) and use whoever you like more. And for the karma , i dont neet bro , i just want to help. if something is missing or not working ( i mean the nanosuit ) be free to tell me
Interested in playing Zombie Plague / Escape servers. If somebody wants to play , PM me with IP
Dude ... these are 2 different codes and you can't make it in one. First compile his code in some .SMA , then compile mine and try the plugins! If you need something missing or whatever just tell me.
Do you understand what im saying to you right now?
Interested in playing Zombie Plague / Escape servers. If somebody wants to play , PM me with IP