Veteran Member
Join Date: Oct 2009
Location: Everywhere
|
12-30-2011
, 09:02
set speed in zp class
|
#1
|
PHP Code:
#include <amxmodx> #include <fakemeta> #include <fun> #include <hamsandwich> #include <zombieplague>
const OFFSET_LINUX = 5 const OFFSET_PAINSHOCK = 108 // ConnorMcLeod
new const zclassKFfleshpound_name[] = { "KF Flesh Pound" } new const zclassKFfleshpound_info[] = { "Get Crazy on shooting" } new const zclassKFfleshpound_model[] = { "KF_Flesh_Pound" } new const zclassKFfleshpound_clawmodel[] = { "v_KF_fleshpound.mdl" } const zclassKFfleshpound_health = 4000 const zclassKFfleshpound_speed = 160 const Float:zclassKFfleshpound_gravity = 1.0 const Float:zclassKFfleshpound_knockback = 0.3
new g_classKFfleshpound new Float:normal_speed = zclassKFfleshpound_speed
new Float:g_kf_crazyhp[33] new bool:g_has_crazy[33] = false new bool:g_painsfree[33] = false
new crazy_hp, cvar_humanspd, crazy_speed
new const crazysound[] = "zombie_plague/KF_Flesh_Pound_crazy.wav" new const gibslaysound[] = "zombie_plague/zp_gibslay.wav"
public plugin_precache() { //Register Plugin register_plugin("[ZP] Class: KF Flesh Pound", "1.0", "GAARA54") //Register Class g_classKFfleshpound = zp_register_zombie_class(zclassKFfleshpound_name, zclassKFfleshpound_info, zclassKFfleshpound_model, zclassKFfleshpound_clawmodel, zclassKFfleshpound_health, zclassKFfleshpound_speed, zclassKFfleshpound_gravity, zclassKFfleshpound_knockback) //Precache Gibslay Sound precache_sound(gibslaysound) precache_sound(crazysound) //Cvars crazy_hp = register_cvar("zp_crazy_hpreduce", "500.0") // How many hp Flesh Pound need to lose to get crazy crazy_speed = register_cvar("zp_kf_crazy_speed", "460.0") cvar_humanspd = register_cvar("zp_human_speed", "240.0") // HamSandWich RegisterHam(Ham_TakeDamage, "player", "KF_fleshpound_takedamage") }
public zp_round_started() { for(new i = 1; i <= get_maxplayers(); i++) { g_has_crazy[i] = false g_painsfree[i] = false g_kf_crazyhp[i] = 0.0 } }
public zp_user_humanized_post(id) { set_user_maxspeed(id, get_pcvar_float(cvar_humanspd)) fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25) g_painsfree[id] = false }
public zp_user_infected_post(id, infector) { if (zp_get_user_zombie_class(id) == g_classKFfleshpound && !zp_get_user_nemesis(id)) { client_printcolor(id, "^4[ZP]^1 You get Flesh Pound class, you will get crazy when will receive^4 %d damage", get_pcvar_num(crazy_hp)) g_has_crazy[id] = false g_kf_crazyhp[id] = 0.0 } }
public zp_user_infect_attempt(victim, infector, nemesis) { if(!is_user_alive(infector)) return PLUGIN_CONTINUE if(!infector || nemesis) return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(infector) == g_classKFfleshpound && !zp_get_user_nemesis(infector)) { if (g_has_crazy[infector] == true) { killexplode(victim) return ZP_PLUGIN_HANDLED } } return PLUGIN_CONTINUE }
public KF_fleshpound_takedamage(victim, weapon, attacker, Float:damage, damagebits) { if(!is_user_alive(victim)) return if (!zp_get_user_zombie(attacker) && zp_get_user_zombie(victim) && zp_get_user_zombie_class(victim) == g_classKFfleshpound && !zp_get_user_nemesis(victim)) { g_painsfree[victim] = false if (g_kf_crazyhp[victim] >= get_pcvar_float(crazy_hp)) { if (g_has_crazy[victim] == true) { return } else { fleshpound_getcrazy(victim) client_print(victim, print_chat, "123") // проверка, сработало или нет } } g_kf_crazyhp[victim]+=damage } }
public fleshpound_getcrazy(victim) { if(!is_user_alive(victim)) return emit_sound(victim, CHAN_BODY, crazysound, 1.0, ATTN_NORM, 0, PITCH_NORM) g_kf_crazyhp[victim] = 0.0 g_has_crazy[victim] = true g_painsfree[victim] = true set_pdata_float(victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX) fm_set_user_maxspeed(victim, get_pcvar_float(crazy_speed)) fm_set_rendering(victim, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 255) set_task(8.0, "uncrazy", victim) }
public uncrazy(victim) { if(!is_user_alive(victim)) return client_print(victim, print_chat, "task complete") // проверка, сработало или нет g_has_crazy[victim] = false g_painsfree[victim] = false g_kf_crazyhp[victim] = 0.0 fm_set_user_maxspeed(victim, normal_speed) fm_set_rendering(victim, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25) }
public killexplode(victim) { SetHamParamInteger(3, 2) emit_sound(victim, CHAN_BODY, gibslaysound, 1.0, ATTN_NORM, 0, PITCH_NORM) }
stock client_printcolor(const id, const input[], any:...) { new iCount = 1, iPlayers[32] static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3) replace_all(szMsg, 190, "/g", "^4") replace_all(szMsg, 190, "/y", "^1") replace_all(szMsg, 190, "/ctr", "^1") replace_all(szMsg, 190, "/w", "^0")
if(id) iPlayers[0] = id else get_players(iPlayers, iCount, "ch") for (new i = 0; i < iCount; i++) { if(is_user_connected(iPlayers[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i]) write_byte(iPlayers[i]) write_string(szMsg) message_end() } } }
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) { static Float:color[3] color[0] = float(r) color[1] = float(g) color[2] = float(b) set_pev(entity, pev_renderfx, fx) set_pev(entity, pev_rendercolor, color) set_pev(entity, pev_rendermode, render) set_pev(entity, pev_renderamt, float(amount)) }
stock fm_set_user_maxspeed(index, Float:speed = -1.0) { engfunc(EngFunc_SetClientMaxspeed, index, speed); set_pev(index, pev_maxspeed, speed);
return 1; }
Hi all, i making zp class Flesh Pound
how i can set speed in this functions ?
PHP Code:
public fleshpound_getcrazy(victim) { if(!is_user_alive(victim)) return emit_sound(victim, CHAN_BODY, crazysound, 1.0, ATTN_NORM, 0, PITCH_NORM) g_kf_crazyhp[victim] = 0.0 g_has_crazy[victim] = true g_painsfree[victim] = true set_pdata_float(victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX) fm_set_user_maxspeed(victim, get_pcvar_float(crazy_speed)) fm_set_rendering(victim, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 255) set_task(8.0, "uncrazy", victim) }
public uncrazy(victim) { if(!is_user_alive(victim)) return client_print(victim, print_chat, "task complete") // проверка, сработало или нет g_has_crazy[victim] = false g_painsfree[victim] = false g_kf_crazyhp[victim] = 0.0 fm_set_user_maxspeed(victim, normal_speed) fm_set_rendering(victim, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25) }
i try ~ 5 methods
fm_set_user_speed
set_user_max_speed
and other
any doesn't work !!
WTF ?
help please
__________________
Last edited by GAARA54; 12-30-2011 at 09:10.
|
|