Raised This Month: $ Target: $400
 0% 

[SOLVED] ZP surv/neme healt.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Garrey
Member
Join Date: Jan 2010
Old 10-10-2010 , 09:03   [SOLVED] ZP surv/neme healt.
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
#include <cstrike>

#define PLUGIN_NAME "[ZP] Show HP"
#define PLUGIN_VERS "2.0"
#define PLUGIN_AUTH "ASSOM\HLDS"

#define TASK_HEALTH 1234554321

new name[32]

public 
plugin_init()
{
   
register_plugin(PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH)
   
register_dictionary("zombie_plague.txt")

   
// Fwd's
   
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
   
RegisterHam(Ham_Killed"player""Fwd_PlayerKilled_Pre"0)
   
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
Fwd_PlayerSpawn_Post(id)
{
   if (
task_exists(id+TASK_HEALTH))
      
remove_task(id+TASK_HEALTH)
}

public 
Fwd_PlayerKilled_Pre(victimattackershouldgib)
{
   if (
task_exists(victim+TASK_HEALTH))
      
remove_task(victim+TASK_HEALTH)
}

public 
event_round_start(modeid)
//public zp_round_started(mode, id)
{
   if (
zp_has_round_started())
   {

      if (
mode == MODE_NEMESIS)
      {
      
set_task(1.0"Health_Nemisis"id+TASK_HEALTH__"b")
      return
      }

      if (
mode == MODE_SURVIVOR)
      {
      
set_task(1.0"Health_Survivor"id+TASK_HEALTH__"b")
      return
      }

   }
}

public 
Health_Nemisis(id)
{
   
id -= TASK_HEALTH
   
   
if (zp_get_user_nemesis(id))
      
      
remove_task(id+TASK_HEALTH)
      
get_user_name(id,name,31)
      
set_hudmessage(250000.050.4501.01.00.10.2, -1)
      
show_hudmessage(0"%s - %L: %d %L"nameLANG_PLAYER"CLASS_NEMESIS"get_user_health(id), LANG_PLAYER"ZOMBIE_ATTRIB1")
}

public 
Health_Survivor(id)
{
   
id -= TASK_HEALTH
   
   
if (zp_get_user_survivor(id))
   
    
remove_task(id+TASK_HEALTH)
    
get_user_name(id,name,31)
    
set_hudmessage(002500.050.4501.01.00.10.2, -1)
    
show_hudmessage(0"%s - %L: %d %L"nameLANG_PLAYER"CLASS_SURVIVOR"get_user_health(id), LANG_PLAYER"ZOMBIE_ATTRIB1")




public 
zp_round_ended()
{
   
remove_task(TASK_HEALTH)
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
I found this, but it wont compile
On line 77, 79 is loose identitation.

Could someone help to fix it?
Attached Files
File Type: sma Get Plugin or Get Source (shownemesurvHP.sma - 564 views - 2.4 KB)
__________________
People are like music, some speak the truth and others are just noise..

Last edited by Garrey; 10-10-2010 at 10:11. Reason: SOLVED! :)
Garrey is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-10-2010 , 09:33   Re: ZP surv/neme healt.
Reply With Quote #2

Ok ... First of all , Ignore loose indentations , they are nothing , by nothing i mean its not a big deal and wont give you any errors...

I just fixed it for you , So you would be happy -.- :
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
#include <cstrike>

#define PLUGIN_NAME "[ZP] Show HP"
#define PLUGIN_VERS "2.0"
#define PLUGIN_AUTH "ASSOM\HLDS"

#define TASK_HEALTH 1234554321

new name[32]

public 
plugin_init()
{
   
register_plugin(PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH)
   
register_dictionary("zombie_plague.txt")

   
// Fwd's
   
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
   
RegisterHam(Ham_Killed"player""Fwd_PlayerKilled_Pre"0)
   
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
Fwd_PlayerSpawn_Post(id)
{
   if (
task_exists(id+TASK_HEALTH))
      
remove_task(id+TASK_HEALTH)
}

public 
Fwd_PlayerKilled_Pre(victimattackershouldgib)
{
   if (
task_exists(victim+TASK_HEALTH))
      
remove_task(victim+TASK_HEALTH)
}

public 
event_round_start(modeid)
//public zp_round_started(mode, id)
{
   if (
zp_has_round_started())
   {

      if (
mode == MODE_NEMESIS)
      {
      
set_task(1.0"Health_Nemisis"id+TASK_HEALTH__"b")
      return
      }

      if (
mode == MODE_SURVIVOR)
      {
      
set_task(1.0"Health_Survivor"id+TASK_HEALTH__"b")
      return
      }

   }
}

public 
Health_Nemisis(id)
{
   
id -= TASK_HEALTH
   
   
if (zp_get_user_nemesis(id))
      
      
remove_task(id+TASK_HEALTH)
   
get_user_name(id,name,31)
   
set_hudmessage(250000.050.4501.01.00.10.2, -1)
   
show_hudmessage(0"%s - %L: %d %L"nameLANG_PLAYER"CLASS_NEMESIS"get_user_health(id), LANG_PLAYER"ZOMBIE_ATTRIB1")
}

public 
Health_Survivor(id)
{
   
id -= TASK_HEALTH
   
   
if (zp_get_user_survivor(id))
   
    
remove_task(id+TASK_HEALTH)
   
get_user_name(id,name,31)
   
set_hudmessage(002500.050.4501.01.00.10.2, -1)
   
show_hudmessage(0"%s - %L: %d %L"nameLANG_PLAYER"CLASS_SURVIVOR"get_user_health(id), LANG_PLAYER"ZOMBIE_ATTRIB1")




public 
zp_round_ended()
{
   
remove_task(TASK_HEALTH)
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Garrey
Member
Join Date: Jan 2010
Old 10-10-2010 , 10:10   Re: ZP surv/neme healt.
Reply With Quote #3

Thank you!
__________________
People are like music, some speak the truth and others are just noise..
Garrey is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-10-2010 , 11:21   Re: [SOLVED] ZP surv/neme healt.
Reply With Quote #4

in event_round_start can use switch() funcion
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-10-2010 , 13:16   Re: [SOLVED] ZP surv/neme healt.
Reply With Quote #5

Code:
event_round_start(mode, id)
WTF event round start is called with no parameters so you must use zp_round_started
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
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 10:24.


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