Raised This Month: $12 Target: $400
 3% 

Subplugin Submission [ZP] Human HP Disguise


Post New Thread Reply   
 
Thread Tools Display Modes
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-05-2009 , 00:04   Re: [ZP] Human HP Disguise
Reply With Quote #11

ADD
Quote:
if(zp_get_user_nemesis(id))
return;
because, i don't want nemesis turn invisible.
Anggara_nothing is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-05-2009 , 00:14   Re: [ZP] Human HP Disguise
Reply With Quote #12

I will upload a separate version for you in a few minutes.
BOYSplayCS is offline
Speed!
BANNED
Join Date: Jan 2009
Old 04-05-2009 , 20:19   Re: [ZP] Human HP Disguise
Reply With Quote #13

Quote:
Originally Posted by Exolent[jNr] View Post
Okay, lets start.

1. I suggest a cvar for the visibility.

2. I don't think you need ".inc" in the #include.
Code:
#include <zombieplague> // should be enough

3.
Code:
if (get_user_health( id ) > get_pcvar_num( hplevel ) || zp_get_user_zombie(id)) {     return PLUGIN_CONTINUE }
This won't help much, but it will help.
Code:
if (zp_get_user_zombie(id) || get_user_health( id ) > get_pcvar_num( hplevel )) {     return PLUGIN_CONTINUE }

4.
Code:
client_print(id, print_chat, "[ZP] Your health is below %d, you are now semi-invisible.", hplevel);
You printed the cvar pointer value, not the cvar value, lol.[/pawn]

5. I haven't tested, but it seems like the message will be displayed every time the player is hurt after the message has shown the first time.

6. I would do it like this:
Code:
#include <amxmodx> #include <amxmisc> #include <zombieplague> #include <fun> #define PLUGIN "Human HP Disguise" #define VERSION "1.0" #define AUTHOR "BOYSplayCS" new hplevel // Amount of HP before turning Semi-Invisible. new invisamount // Alpha amount for when player has become Semi-Invisible new g_old_health[33]; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("Health", "EventHealth", "b");         hplevel = register_cvar("zp_disguise_health", "35");     invisamount = register_cvar("zp_disguise_alpha", "0"); } public EventHealth(client) {     new health = read_data(2);     if( health == g_old_health[client] ) return;         if( !zp_get_user_zombie(id) && health > 0 )     {         new disguise_amount = get_pcvar_num(hplevel);         if( health <= disguise_amount && g_old_health[client] > disguise_amount )         {             set_user_rendering(client, kRenderFxNone, 0, 0, 0, kRenderTransAdd, get_pcvar_num(invisamount));             client_print(client, print_chat, "[ZP] Your health is below %d, you are now semi-invisible.", disguise_amount);         }     }         g_old_health[client] = health; }

Also, you can take these same suggestions for the "Normal" version.
using static's and using cached cvars at round start would be nice
Speed! is offline
1337
Senior Member
Join Date: Mar 2009
Old 06-13-2009 , 17:08   Re: [ZP] Human HP Disguise
Reply With Quote #14

doesnt work
1337 is offline
obione
Junior Member
Join Date: Jan 2010
Old 01-06-2010 , 12:53   Re: [ZP] Human HP Disguise
Reply With Quote #15

Error: Undefined symbol "id" on line 29
obione is offline
a.aqua
Senior Member
Join Date: Jul 2009
Location: Russia
Old 03-28-2010 , 07:58   Re: [ZP] Human HP Disguise
Reply With Quote #16

Автор ппц кривой.

On line 29 change:
Code:
	if( !zp_get_user_zombie(id)  && health > 0 )
to
Code:
	if( !zp_get_user_zombie(client) || !zp_get_user_nemesis(client) && health > 0 )
__________________
a.aqua is offline
Send a message via ICQ to a.aqua
Martin
BANNED
Join Date: Mar 2009
Location: China
Old 05-07-2010 , 02:55   Re: [ZP] Human HP Disguise
Reply With Quote #17

oh~ shit!!!! oh~ cool~@@
Martin is offline
Send a message via ICQ to Martin
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 23:40.


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