Junior Member
|
04-12-2012
, 21:17
Re: [Zp] Otra ayuda con zClasses
|
#3
|
Pero al plugins me lo compila perfecto.
PHP Code:
#include <amxmodx> #include <fakemeta> #include <engine> #include <zombieplague>
// Zombie Attributes new const zclass_name[] = "Deimos Zombie" // name new const zclass_info[] = "| G -> Drop Human Weapon" // description new const zclass_model[] = "deimos_zombi_origin" // model new const zclass_clawmodel[] = "v_knife_deimos_zombi.mdl" // claw model const zclass_health = 2000 // health const zclass_speed = 280 // speed const Float:zclass_gravity = 1.0 // gravity const Float:zclass_knockback = 1.0 // knockback const zclass_lvl = 0 // level
new g_zclass_deimos new bool:can_use_skill[33]
new trail_spr new exp_spr
const m_flTimeWeaponIdle = 48 const m_flNextAttack = 83
new const light_classname[] = "deimos_skill" new const skill_start[] = "zombie_plague/deimos_skill_start.wav" new const skill_hit[] = "zombie_plague/deimos_skill_hit.wav"
#define TASK_WAIT 11111 #define TASK_ATTACK 22222 #define TASK_COOLDOWN 33333
const WPN_NOT_DROP = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new cvar_cooldown
public plugin_init() { register_plugin("[ZP] Zombie Class: Deimos", "1.0", "Dias") cvar_cooldown = register_cvar("zp_deimos_cooldown", "30") register_forward(FM_Touch, "fw_Touch") register_clcmd("drop", "use_skill") }
public plugin_precache() { trail_spr = precache_model("sprites/zb3/trail.spr") exp_spr = precache_model("sprites/zb3/deimosexp.spr") precache_sound(skill_start) precache_sound(skill_hit) g_zclass_deimos = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback, zclass_lvl) }
public zp_user_infected_post(id, infector) { if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos) { can_use_skill[id] = true client_print(id, print_chat, "[ZP] You are Deimos Zombie, Aim and Press (G) to Drop Human Weapon") } }
public use_skill(id) { if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos && !zp_get_user_nemesis(id)) { if(can_use_skill[id]) { do_skill(id) can_use_skill[id] = false } else { client_print(id, print_chat, "[ZP] You can't use your skill now...") } } }
public do_skill(id) { play_weapon_anim(id, 8) set_weapons_timeidle(id, 7.0) set_player_nextattack(id, 0.5) PlayEmitSound(id, skill_start) entity_set_int(id, EV_INT_sequence, 10)
set_task(0.5, "launch_light", id+TASK_ATTACK) }
public launch_light(taskid) { new id = taskid - TASK_ATTACK if (task_exists(id+TASK_ATTACK)) remove_task(id+TASK_ATTACK) if (!is_user_alive(id)) return; // check new Float: fOrigin[3], Float:fAngle[3],Float: fVelocity[3] pev(id, pev_origin, fOrigin) pev(id, pev_view_ofs, fAngle) fm_velocity_by_aim(id, 2.0, fVelocity, fAngle) fAngle[0] *= -1.0 // create ent new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) set_pev(ent, pev_classname, light_classname) engfunc(EngFunc_SetModel, ent, "models/w_hegrenade.mdl") set_pev(ent, pev_mins, Float:{-1.0, -1.0, -1.0}) set_pev(ent, pev_maxs, Float:{1.0, 1.0, 1.0}) set_pev(ent, pev_origin, fOrigin) fOrigin[0] += fVelocity[0] fOrigin[1] += fVelocity[1] fOrigin[2] += fVelocity[2] set_pev(ent, pev_movetype, MOVETYPE_BOUNCE) set_pev(ent, pev_gravity, 0.01) fVelocity[0] *= 1000 fVelocity[1] *= 1000 fVelocity[2] *= 1000 set_pev(ent, pev_velocity, fVelocity) set_pev(ent, pev_owner, id) set_pev(ent, pev_angles, fAngle) set_pev(ent, pev_solid, SOLID_BBOX) //store the enitty id // invisible ent fm_set_rendering(ent, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0) // show trail message_begin( MSG_BROADCAST, SVC_TEMPENTITY ) write_byte(TE_BEAMFOLLOW) write_short(ent) //entity write_short(trail_spr) //model write_byte(5) //10)//life write_byte(3) //5)//width write_byte(209) //r, hegrenade write_byte(120) //g, gas-grenade write_byte(9) //b write_byte(200) //brightness message_end() //move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS) client_print(id, print_chat, "[ZP] You have to wait %i seconds to continue use skill !!!", get_pcvar_num(cvar_cooldown)) set_task(get_pcvar_float(cvar_cooldown), "reset_cooldown", id+TASK_COOLDOWN) return; }
public reset_cooldown(taskid) { new id = taskid - TASK_COOLDOWN if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_deimos && !zp_get_user_nemesis(id)) { can_use_skill[id] = true client_print(id, print_chat, "[ZP] Now. You can use your skill. Aim and Press (G)") } }
public fw_Touch(ent, victim) { if (!pev_valid(ent)) return FMRES_IGNORED new EntClassName[32] entity_get_string(ent, EV_SZ_classname, EntClassName, charsmax(EntClassName)) if (equal(EntClassName, light_classname)) { light_exp(ent, victim) remove_entity(ent) return FMRES_IGNORED } return FMRES_IGNORED }
light_exp(ent, victim) { if (!pev_valid(ent)) return; if (is_user_alive(victim) && !zp_get_user_zombie(victim) && !zp_get_user_survivor(victim)) { new wpn, wpnname[32] wpn = get_user_weapon(victim) if( !(WPN_NOT_DROP & (1<<wpn)) && get_weaponname(wpn, wpnname, charsmax(wpnname)) ) { engclient_cmd(victim, "drop", wpnname) } } // create effect static Float:origin[3]; pev(ent, pev_origin, origin); message_begin(MSG_BROADCAST,SVC_TEMPENTITY); write_byte(TE_EXPLOSION); // TE_EXPLOSION write_coord(floatround(origin[0])); // origin x write_coord(floatround(origin[1])); // origin y write_coord(floatround(origin[2])); // origin z write_short(exp_spr); // sprites write_byte(40); // scale in 0.1's write_byte(30); // framerate write_byte(14); // flags message_end(); // message end // play sound exp PlayEmitSound(ent, skill_hit) }
PlayEmitSound(id, const sound[]) { emit_sound(id, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM) }
play_weapon_anim(player, anim) { set_pev(player, pev_weaponanim, anim) message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, player) write_byte(anim) write_byte(pev(player, pev_body)) message_end() }
fm_velocity_by_aim(iIndex, Float:fDistance, Float:fVelocity[3], Float:fViewAngle[3]) { //new Float:fViewAngle[3] pev(iIndex, pev_v_angle, fViewAngle) fVelocity[0] = floatcos(fViewAngle[1], degrees) * fDistance fVelocity[1] = floatsin(fViewAngle[1], degrees) * fDistance fVelocity[2] = floatcos(fViewAngle[0]+90.0, degrees) * fDistance return 1 }
get_weapon_ent(id, weaponid) { static wname[32], weapon_ent get_weaponname(weaponid, wname, charsmax(wname)) weapon_ent = fm_find_ent_by_owner(-1, wname, id) return weapon_ent }
set_weapons_timeidle(id, Float:timeidle) { new entwpn = get_weapon_ent(id, get_user_weapon(id)) if (pev_valid(entwpn)) set_pdata_float(entwpn, m_flTimeWeaponIdle, timeidle+3.0, 4) }
set_player_nextattack(id, Float:nexttime) { set_pdata_float(id, m_flNextAttack, nexttime, 4) }
stock fm_find_ent_by_owner(entity, const classname[], owner) { while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) { /* keep looping */ } return entity; }
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)) }
Y al agregar al zclasses me tira ese error. Tengo asi las clases
PHP Code:
#include <amxmodx> #include <fakemeta> #include <zombieplague>
/*================================================================================ [Plugin Customization] =================================================================================*/
// Fast Jumper Zombie Attributes new const zclass2_name[] = { "Fast Jumper" } new const zclass2_info[] = { "Low Gravity,Fast" } new const zclass2_model[] = { "fast_jumper" } new const zclass2_clawmodel[] = { "v_fast_jumper.mdl" } const zclass2_health = 2500 const zclass2_speed = 320 const Float:zclass2_gravity = 0.4 const Float:zclass2_knockback = 0.8 const zclass2_lvl = 0
// Raptor Zombie Attributes new const zclass3_name[] = { "Raptor Zombie" } new const zclass3_info[] = { "HP-- Speed++ Knockback++" } new const zclass3_model[] = { "zombie_source" } new const zclass3_clawmodel[] = { "v_knife_zombie.mdl" } const zclass3_health = 900 const zclass3_speed = 225 const Float:zclass3_gravity = 1.0 const Float:zclass3_knockback = 1.5 const zclass3_lvl = 0
// Classic Zombie Attributes new const zclass5_name[] = { "Classic Zombie" } new const zclass5_info[] = { "=Balanced=" } new const zclass5_model[] = { "zombie_source" } new const zclass5_clawmodel[] = { "v_knife_zombie.mdl" } const zclass5_health = 1800 const zclass5_speed = 190 const Float:zclass5_gravity = 1.0 const Float:zclass5_knockback = 1.0 const zclass5_lvl = 0
// Poison Zombie Attributes new const zclass6_name[] = { "Poison Zombie" } new const zclass6_info[] = { "HP- Jump+ Knockback+" } new const zclass6_model[] = { "zombie_source" } new const zclass6_clawmodel[] = { "v_knife_zombie.mdl" } const zclass6_health = 1400 const zclass6_speed = 190 const Float:zclass6_gravity = 0.75 const Float:zclass6_knockback = 1.25 const zclass6_lvl = 0
// Big Zombie Attributes new const zclass8_name[] = { "Big Zombie" } new const zclass8_info[] = { "HP++ Speed- Knockback--" } new const zclass8_model[] = { "zombie_source" } new const zclass8_clawmodel[] = { "v_knife_zombie.mdl" } const zclass8_health = 2700 const zclass8_speed = 155 const Float:zclass8_gravity = 1.0 const Float:zclass8_knockback = 0.5 const zclass8_lvl = 0
// Leech Zombie Attributes new const zclass14_name[] = { "Leech Zombie" } new const zclass14_info[] = { "HP- Knockback+ Leech++" } new const zclass14_model[] = { "zombie_source" } new const zclass14_clawmodel[] = { "v_knife_zombie.mdl" } const zclass14_health = 1300 const zclass14_speed = 190 const Float:zclass14_gravity = 1.0 const Float:zclass14_knockback = 1.25 const zclass14_infecthp = 200 // extra hp for infections const zclass14_lvl = 0
/*============================================================================*/
// Class IDs new g_zclass_leech, g_zclass_deimos
// Zombie Classes MUST be registered on plugin_precache public plugin_precache() { register_plugin("[ZP] Default Zombie Classes", "4.3", "MeRcyLeZZ") // Register all classes zp_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, zclass2_knockback, zclass2_lvl) zp_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, zclass3_knockback, zclass3_lvl) zp_register_zombie_class(zclass5_name, zclass5_info, zclass5_model, zclass5_clawmodel, zclass5_health, zclass5_speed, zclass5_gravity, zclass5_knockback, zclass5_lvl) zp_register_zombie_class(zclass6_name, zclass6_info, zclass6_model, zclass6_clawmodel, zclass6_health, zclass6_speed, zclass6_gravity, zclass6_knockback, zclass6_lvl) zp_register_zombie_class(zclass8_name, zclass8_info, zclass8_model, zclass8_clawmodel, zclass8_health, zclass8_speed, zclass8_gravity, zclass8_knockback, zclass8_lvl) g_zclass_leech = zp_register_zombie_class(zclass14_name, zclass14_info, zclass14_model, zclass14_clawmodel, zclass14_health, zclass14_speed, zclass14_gravity, zclass14_knockback, zclass14_lvl) g_zclass_deimos = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback, zclass_lvl) }
// User Infected forward public zp_user_infected_post(id, infector) { // If attacker is a leech zombie, gets extra hp if (zp_get_user_zombie_class(infector) == g_zclass_leech) set_pev(infector, pev_health, float(pev(infector, pev_health) + zclass14_infecthp)) }
|
|