AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   HP Left (https://forums.alliedmods.net/showthread.php?t=57735)

TSCDan 07-10-2007 10:30

HP Left
 
1 Attachment(s)
HP Left
This is a somewhat simple plugin that, on your death, will display who killed you, with what, from how far away, and how much HP that player had left. This gets displayed to chat, and can be re-displayed by typing "hp" in chat.

Installation
Place hp_left.smx in your plugins directory, on server start/map change it will be loaded.

Changelog
1.0 - Release
1.1 - Stupid mistake fix

Let me know if you have any questions/comments/requests :D

^BuGs^ 07-10-2007 12:31

Re: HP Left
 
Suggestion, make a console command "sm_hp" and it should create the !hp and /hp functionaility easier.

ferret 07-10-2007 12:57

Re: HP Left
 
Code:

//Make sure they've died already
 if(distances[client] == 0){
  PrintToChat(client,"\x04You have not died yet")
  return Plugin_Continue
 }

You should move this to AFTER you check if they said /hp:

Code:

if(strcmp(user_command[start_index],"hp",false)==0 || strcmp(user_command[start_index],"/hp",false)==0){
  printInfo(client)
 }

Otherwise, everyone will see this message EVERYTIME they use say or say_team.

TSCDan 07-10-2007 13:06

Re: HP Left
 
ferret: Thanks, dunno how I missed that *smacks head*, although it would only have mattered if they hadn't died yet. Fixed now.

^BuGs^: Wouldn't that only work if I had ! or / as my admin command string? I only use @.

ferret 07-10-2007 13:11

Re: HP Left
 
Don't use @. You'll have problems on any server running basechat. @ has traditionally been reserved as an alias to commands related to chat features.

If you do what Bugs is suggesting, you'll basicly just make the command sm_hp. You won't use "say" or "say_team" at all.

You don't have to worry about chat or if there quotes. If you make "sm_hp", SourceMod will AUTOMAGICKALLY create !hp and /hp for you and take out the quotes.

Also, if you change it to sm_hp, you should switch from "PrintToChat" to "ReplyToCommand"

ReplyToCommand automaticly switches from "PrintToConsole" to "PrintToChat", depending on if the user typed it in console or chat.

TSCDan 07-10-2007 13:35

Re: HP Left
 
Thanks, I'll take a look into that when I get home.

Rebell 07-10-2007 14:05

Re: HP Left
 
Nice.... like oldskool ^^

cya

:THM: SFG 07-10-2007 19:14

Re: HP Left
 
Hi TSCDan,

a "small" feature request:
Let the plugin show the date (distance, weapon, hp left, etc.) in a pop-up-windows (like all the menus in the left side).

And define a server variable, so admins can set it to "on" or "off" as standard for everyone.

And if the standard is set to "on", every player should be able to disable the function for himsel by "/hp".


That would be really perfect!


:THM: SFG



€dit: Ok, now i saw someone requested a very small plugin for the chat area in the "HL2 plugin idea" forum-part and you said you will make it and here it is. But perhaps there could be a variable, too, letting the admin decide where the data should be displayed, chat-area, menu-style-window, etc.

TSCDan 07-10-2007 20:03

Re: HP Left
 
I'll see what I can do. I guess it would be a good learning experience :P

:THM: SFG 07-10-2007 20:04

Re: HP Left
 
Good to hear! Thx...


All times are GMT -4. The time now is 00:01.

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