Raised This Month: $ Target: $400
 0% 

What is wrong ????


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-10-2011 , 14:03   What is wrong ????
Reply With Quote #1

PHP Code:
 
public ShowHUD(taskid)
{
 static 
id
 id 
ID_SHOWHUD;
 
 
// Player died?
 
if (!g_isalive[id])
 {
  
// Get spectating target
  
id pev(idPEV_SPEC_TARGET)
 
  
// Target not alive
  
if (!g_isalive[id]) return;
 }
 
 
// Format classname
 
static class[32], redgreenbluehudxhudy
 
 
if (g_zombie[id]) // zombies
 
{
  
red 171
  green 
16
  blue 
16
  hudx 
get_pcvar_float(cvar_zombie_hud_x)
  
hudy get_pcvar_float(cvar_zombie_hud_y)
 
  if (
g_nemesis[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_NEMESIS")
  else if (
g_assassin[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_ASSASSIN")
  else
   
copy(class, charsmax(class), g_zombie_classname[id])
 }
 else 
// humans
 
{
  
red 2
  green 
105
  blue 
189
  hudx 
get_pcvar_float(cvar_human_hud_x)
  
hudy get_pcvar_float(cvar_human_hud_y)
 
  if (
g_survivor[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_SURVIVOR")
  else if (
g_sniper[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_SNIPER")
  else if (
g_wesker[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_WESKER")
  else
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_HUMAN")
 }
 
 
// Spectating someone else?
 
if (id != ID_SHOWHUD)
 {
  
// Show name, health, class, and ammo packs and armor
  
set_hudmessage(106106106HUD_SPECT_XHUD_SPECT_Y16.01.10.00.0, -1)
  
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L %L %s^nHP: %d | %L %s | %L %d %L"ID_SHOWHUD"BAR_CODE1"ID_SHOWHUD"SPECTATING"g_playername[id],
  
pev(idpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[id], ID_SHOWHUD"BAR_CODE2")
 }
 else
 {
  
// Show health, class and ammo packs and armor
  
set_hudmessage(redgreenbluehudxhudy06.01.10.00.0, -1)
  
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L %L: %d | %L %s | %L %d %L"ID_SHOWHUD"BAR_CODE1"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS",
  class, 
ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], ID_SHOWHUD"BAR_CODE2")
 }

Something is wrong. I cant compile , get error : tag mismatch 12151 line.

Last edited by .Dare Devil.; 05-10-2011 at 14:05.
.Dare Devil. is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-10-2011 , 14:22   Re: What is wrong ????
Reply With Quote #2

Tell us the line 12151 then?
bibu is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-10-2011 , 14:50   Re: What is wrong ????
Reply With Quote #3

PHP Code:
 
public ShowHUD(taskid)
{
 static 
id
 id 
ID_SHOWHUD;
 
 
// Player died?
 
if (!g_isalive[id])
 {
  
// Get spectating target
  
id pev(idPEV_SPEC_TARGET)
 
  
// Target not alive
  
if (!g_isalive[id]) return;
 }
 
 
// Format classname
 
static class[32], redgreenbluehudxhudy
 
 
if (g_zombie[id]) // zombies
 
{
  
red 171
  green 
16
  blue 
16
  hudx 
get_pcvar_float(cvar_zombie_hud_x)
  
hudy get_pcvar_float(cvar_zombie_hud_y)
 
  if (
g_nemesis[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_NEMESIS")
  else if (
g_assassin[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_ASSASSIN")
  else
   
copy(class, charsmax(class), g_zombie_classname[id])
 }
 else 
// humans
 
{
  
red 2
  green 
105
  blue 
189
  hudx 
get_pcvar_float(cvar_human_hud_x)
  
hudy get_pcvar_float(cvar_human_hud_y)
 
  if (
g_survivor[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_SURVIVOR")
  else if (
g_sniper[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_SNIPER")
  else if (
g_wesker[id])
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_WESKER")
  else
   
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_HUMAN")
 }
 
 
// Spectating someone else?
 
if (id != ID_SHOWHUD)
 {
  
// Show name, health, class, and ammo packs and armor
  
set_hudmessage(106106106HUD_SPECT_XHUD_SPECT_Y16.01.10.00.0, -1)
  
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L %L %s^nHP: %d | %L %s | %L %d %L"ID_SHOWHUD"BAR_CODE1"ID_SHOWHUD"SPECTATING"g_playername[id],
  
pev(idpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[id], ID_SHOWHUD"BAR_CODE2")
 }
 else
 {
  
// Show health, class and ammo packs and armor
 
here  --- » set_hudmessage(redgreenbluehudxhudy06.01.10.00.0, -1)
  
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L %L: %d | %L %s | %L %d %L"ID_SHOWHUD"BAR_CODE1"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS",
  class, 
ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], ID_SHOWHUD"BAR_CODE2")
 }

.Dare Devil. is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-10-2011 , 15:04   Re: What is wrong ????
Reply With Quote #4

Yeah, i got this working.
I just make other way.
.Dare Devil. is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-10-2011 , 15:07   Re: What is wrong ????
Reply With Quote #5

.Dare Devil.
I can't find any problem. What is tag mismatch line?

Edited:
Okay. Oh, btw: don't use get_pcvar_float on every function call. Cache this cvar into float variable and use this variable instead.
__________________

SonicSonedit is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-10-2011 , 19:35   Re: What is wrong ????
Reply With Quote #6

IIRC, tag mismatch is not an 'error' and does not prevent a plugin from compiling.
__________________
fysiks is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-11-2011 , 06:14   Re: What is wrong ????
Reply With Quote #7

I use ohter way and this way what i use now, working fine.

but thanks .
.Dare Devil. is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-11-2011 , 09:59   Re: What is wrong ????
Reply With Quote #8

Your hudx and hudy aren't stated as floats, you're assigning floats to them but that doesn't make them float.
Quote:
Originally Posted by .Dare Devil. View Post
static class[32], red, green, blue, hudx, hudy
->
Code:
static class[32], red, green, blue, Float:hudx, Float:hudy
__________________
Hunter-Digital is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-11-2011 , 10:50   Re: What is wrong ????
Reply With Quote #9

Quote:
Originally Posted by Hunter-Digital View Post
Your hudx and hudy aren't stated as floats, you're assigning floats to them but that doesn't make them float.

->
Code:
static class[32], red, green, blue, Float:hudx, Float:hudy
Thanks again

but i really use this way now
.Dare Devil. is offline
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 04:30.


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