Raised This Month: $ Target: $400
 0% 

[Help] Zp Class ghost


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-27-2011 , 08:41   [Help] Zp Class ghost
Reply With Quote #1

When i put on my server this class i got this error: (i use ZP 5.0.7)
[ZP] Invalid Player (0)
[AMXX] Displaying debug trace (plugin "zp_zcls_ghost.amxx")
[AMXX] Run time error 10: native error (native "zp_class_zombie_get_current")
And when i turned in human i am invisible help pls....


This line:
Quote:
if((zp_class_zombie_get_current(attacker) == g_zclass_ghost) && !zp_class_nemesis_get(attacker))
Quote:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_zombie>
#include <engine>

#define PLUGIN "[ZP] Class - Ghost"
#define VERSION "1.3"
#define AUTHOR "HoRRoR, Fry!"

// Zombie Attributes
new g_zclass_ghost
new const zombieclass7_name[] = "Ghost Zombie"
new const zombieclass7_info[] = "- Can be invisible -"
new const zombieclass7_models[][] = { "zombie_ghost" }
new const zombieclass7_clawmodels[][] = { "models/zombie_plague/v_knife_ghost.mdl" }
const zombieclass7_health = 4600
const Float:zombieclass7_speed = 1.0
const Float:zombieclass7_gravity = 0.75
const Float:zombieclass7_knockback = 1.5

new i_stealth_time_hud[33]
new g_cooldown[33]
new g_infections[33]
new Float:g_stealth_time[33]
new i_cooldown_time[33]
new g_maxplayers

// --- config ------------------------ //
new Float:g_stealth_time_standart = 5.0 //first stealth time
new Float:g_stealth_cooldown_standart = 25.0 //cooldown time
new const sound_ghost_stealth[] = "zombie_plague/spells/zombie_ghost/stealth.wav" //stealth sound
new const sound_ghost_stealth_end[] = "zombie_plague/spells/zombie_ghost/end_stealth.wav" //end stealth sound
// ----------------------------------- //



public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_ghost_zombie",VERSIO N,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FC VAR_SPONLY)
register_clcmd("ability1", "use_ability_one")
register_concmd("ability1", "use_ability_one")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_logevent("roundStart", 2, "1=Round_Start")
g_maxplayers = get_maxplayers()
}

public plugin_precache()
{
new index

g_zclass_ghost = zp_class_zombie_register(zombieclass7_name, zombieclass7_info, zombieclass7_health, zombieclass7_speed, zombieclass7_gravity)
zp_class_zombie_register_kb(g_zclass_ghost, zombieclass7_knockback)
for (index = 0; index < sizeof zombieclass7_models; index++)
zp_class_zombie_register_model(g_zclass_ghost , zombieclass7_models[index])
for (index = 0; index < sizeof zombieclass7_clawmodels; index++)
zp_class_zombie_register_claw(g_zclass_ghost, zombieclass7_clawmodels[index])
precache_sound(sound_ghost_stealth)
precache_sound(sound_ghost_stealth_end)
}

public roundStart()
{
for (new i = 1; i <= g_maxplayers; i++)
{
i_cooldown_time[i] = floatround(g_stealth_cooldown_standart)
g_cooldown[i] = 0
remove_task(i)
}
}

public use_ability_one(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_core_is_zombie(id) && !zp_class_nemesis_get(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
if(g_cooldown[id] == 0)
{
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
emit_sound(id, CHAN_STREAM, sound_ghost_stealth, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(g_stealth_time[id],"ghost_make_visible",id)
set_task(g_stealth_cooldown_standart,"reset_c ooldown",id)
g_cooldown[id] = 1

i_cooldown_time[id] = floatround(g_stealth_cooldown_standart)
i_stealth_time_hud[id] = floatround(g_stealth_time[id])

set_task(1.0, "ShowHUD", id, _, _, "a",i_cooldown_time[id])
set_task(1.0, "ShowHUDstealthes", id, _, _, "a",i_stealth_time_hud[id])
}
}
}


public ShowHUD(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_core_is_zombie(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
i_cooldown_time[id] = i_cooldown_time[id] - 1;
set_hudmessage(200, 100, 0, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Stealth cooldown: %d",i_cooldown_time[id])
}else{
remove_task(id)
}
}

public ShowHUDstealthes(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_core_is_zombie(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
i_stealth_time_hud[id] = i_stealth_time_hud[id] - 1;
set_hudmessage(200, 100, 0, -1.0, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Stealth time: %d",i_stealth_time_hud[id])
}else{
remove_task(id)
}
}

public ghost_make_visible(id)
{
if(is_valid_ent(id) && zp_core_is_zombie(id) && !zp_class_nemesis_get(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 125)
emit_sound(id, CHAN_STREAM, sound_ghost_stealth_end, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}

public reset_cooldown(id)
{
if(is_valid_ent(id) && zp_core_is_zombie(id) && !zp_class_nemesis_get(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
g_cooldown[id] = 0

new text[100]
format(text,99,"^x04[ZP]^x01 Your ability ^x04Stealth^x01 is ready.")
message_begin(MSG_ONE,get_user_msgid("SayText "),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}

public zp_fw_core_infect_post(id, attacker)
{
if (zp_class_zombie_get_current(id) == g_zclass_ghost && !zp_class_nemesis_get(id))
{
set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 125)

new text[100]
new note_cooldown = floatround(g_stealth_cooldown_standart)
new note_stealthtime = floatround(g_stealth_time_standart)
format(text,99,"^x04[ZP]^x01 Your ability is ^x04Stealth^x01. Cooldown:^x04 %d ^x01seconds. Stealth time: ^x04%d^x01 seconds.",note_cooldown,note_stealthtime)
message_begin(MSG_ONE,get_user_msgid("SayText "),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()

i_cooldown_time[id] = floatround(g_stealth_cooldown_standart)
remove_task(id)

g_stealth_time[id] = g_stealth_time_standart
g_cooldown[id] = 0
g_infections[id] = 0

client_cmd(id,"bind F1 ability1")
}

if((zp_class_zombie_get_current(attacker) == g_zclass_ghost) && !zp_class_nemesis_get(attacker))
{
g_stealth_time[attacker] = g_stealth_time[attacker] + 1;
infections_hud(attacker)
}
}

public infections_hud(id)
{
if(is_valid_ent(id) && zp_core_is_zombie(id) && !zp_class_nemesis_get(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
new i_stealth_time = floatround(g_stealth_time[id])
new text[100]
format(text,99,"^x04[ZP]^x01 Your stealth time is^x04 %d ^x01seconds.",i_stealth_time)
message_begin(MSG_ONE,get_user_msgid("SayText "),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}

public zp_user_unfrozen(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_core_is_zombie(id) && !zp_class_nemesis_get(id) && zp_class_zombie_get_current(id) == g_zclass_ghost)
{
set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 125)
}
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (!(damage_type & DMG_FALL) || !zp_core_is_zombie(victim) || zp_class_zombie_get_current(victim) != g_zclass_ghost)
return HAM_IGNORED

SetHamParamFloat(4, 0.0)
return HAM_HANDLED
}

public fw_PlayerPreThink(player)
{
if(!is_user_alive(player))
return FMRES_IGNORED

if(zp_core_is_zombie(player) && zp_class_zombie_get_current(player) == g_zclass_ghost)
set_pev(player, pev_flTimeStepSound, 999)

return FMRES_IGNORED
}
__________________


Last edited by nomat; 12-27-2011 at 08:43.
nomat is offline
Send a message via Skype™ to nomat
Isaac999
Senior Member
Join Date: Nov 2011
Location: Home
Old 12-28-2011 , 00:46   Re: [Help] Zp Class ghost
Reply With Quote #2

Check if user is alive
__________________
Isaac999 is offline
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 12-28-2011 , 04:41   Re: [Help] Zp Class ghost
Reply With Quote #3

Quote:
Originally Posted by Isaac999 View Post
Check if user is alive
is user connect
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-28-2011 , 04:43   Re: [Help] Zp Class ghost
Reply With Quote #4

but when i turned in human next round i am invisible......
__________________

nomat is offline
Send a message via Skype™ to nomat
Isaac999
Senior Member
Join Date: Nov 2011
Location: Home
Old 12-28-2011 , 05:13   Re: [Help] Zp Class ghost
Reply With Quote #5

Quote:
Originally Posted by nomat View Post
but when i turned in human next round i am invisible......
You din't check if he is a human
__________________
Isaac999 is offline
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-31-2011 , 04:44   Re: [Help] Zp Class ghost
Reply With Quote #6

but how to check if he is a human? help pls
__________________

nomat is offline
Send a message via Skype™ to nomat
Isaac999
Senior Member
Join Date: Nov 2011
Location: Home
Old 12-31-2011 , 05:18   Re: [Help] Zp Class ghost
Reply With Quote #7

Quote:
Originally Posted by nomat View Post
but how to check if he is a human? help pls
if (!zp_core_is_zombie(attacker))
__________________
Isaac999 is offline
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-31-2011 , 18:56   Re: [Help] Zp Class ghost
Reply With Quote #8

problem fixed please close this topic thx so much for help
__________________


Last edited by nomat; 01-01-2012 at 04:55.
nomat is offline
Send a message via Skype™ to nomat
Reply



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 21:26.


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