Raised This Month: $ Target: $400
 0% 

Report Your Help To TeamMates


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Joshua
New Member
Join Date: Oct 2007
Old 10-08-2007 , 10:00   Report Your Help To TeamMates
Reply With Quote #1

Hello my first plugin it report health to teammate by binding key to amx_showhealth

plz go easy on me its my first
Attached Files
File Type: sma Get Plugin or Get Source (show_health.sma - 616 views - 1.1 KB)
Joshua is offline
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 10-08-2007 , 10:34   Re: Report Your Help To TeamMates
Reply With Quote #2

Reading the code:

You don't need to include all of those incs. You'll prolly need nothing more than amxmodx. And you're also showing the health to all players, not your teammates.

Edit: Also, what part did you do yourself? This looks like alot of copy-pasting. Also, the cvar and your stock function are not needed, and calling "amx_showhealth" many times in a row would be different than users health.

In another words, it won't work.
__________________
I am not a number. I am Gordon Freeman!

Last edited by Pro Patria Finland; 10-08-2007 at 10:36.
Pro Patria Finland is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 10-08-2007 , 11:31   Re: Report Your Help To TeamMates
Reply With Quote #3

That code really is horrible, tbh.

When getting their health, you do some weird stuff ;-)

Why do you use a cvar?

And why do you overwrite value of the cvar-pointer with the health?

You should just do:
PHP Code:
health get_user_health(id);
     
client_print(0print_center"[AMX] %s health is %i"playernamehealth
purple_pixie is offline
Roach
Writes love letters to sawce Daily
Join Date: Jul 2006
Location: Internet
Old 10-08-2007 , 16:40   Re: Report Your Help To TeamMates
Reply With Quote #4

Didnt know geoip, nvault, regex, engine, fakemeta, amxmisc, and fun were needed for all of....

20 lines of code that really only uses amxmodx includes ;).

A good first stab, but like PPF said, its not gonna work as fluidly as you want it to. There is a much simpler way to do this.

Aaaaand it looks like pixie beat me to describing how to do it.
__________________
Quote:
Originally Posted by Brad View Post
That sounds like a really good idea!
Now replace the word "good" with "dumb".
What was your rationale for proposing such a thing?
Roach is offline
Joshua
New Member
Join Date: Oct 2007
Old 10-08-2007 , 17:14   Re: Report Your Help To TeamMates
Reply With Quote #5

sorry plz unapprove this now!!
Joshua 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 08:59.


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