Raised This Month: $ Target: $400
 0% 

Last Seen Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-04-2007 , 17:43   Last Seen Player
Reply With Quote #1

Hello, and good evening to all, hope your watching the SuperBowl /Go COLTS!

Anyway:

I need help on Part of my plugin, This first half is going to relate on: /lastseen which will in chat(ADVANCED DEFINITION: CTSAY) display a message, leave the message space blank if you will. But this chat command should tell you the last player you saw was and there HP. If you will please produce this code for me. I thank anyone who helps me, and help's me out with my problem. Your help will be engraved(if you will) Into the code and post, onced released.

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Chat Commands"
#define VERSION "0.1"
#define AUTHOR "Phantom Warrior"


public plugin_init() {
    register_plugin(Chat Commands, 0.1, Phantom Warrior)
    
    register_clcmd("say /lastseen", "SeenPlayer")
}

Last edited by Phantom Warrior; 02-04-2007 at 17:47. Reason: Forgot to add code -,-
Phantom Warrior is offline
Old 02-04-2007, 23:43
Phantom Warrior
This message has been deleted by Greentryst. Reason: bumping is not allowed until 2 weeks since last post in thread
Old 02-05-2007, 22:03
allenwr
This message has been deleted by Greentryst. Reason: you're not a moderator
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 02-05-2007 , 22:22   Re: Last Seen Player
Reply With Quote #4

Your register_plugin was done wrong .

Add quotes around your parameters or replace them with PLUGIN, VERSION, and AUTHOR.

Code:
#include <amxmodx>
#include <engine>

new lastseen[33]

public plugin_init()
{
	register_plugin("Chat Commands", "0.1", "Phantom Warrior")
    
	register_clcmd("say /lastseen", "SeenPlayer")

	register_event("ResetHUD","resetHUD","b")
}

public client_PreThink(id)
{
	new target,body
	get_user_aiming(id,target,body,100)
	if (target != 0)
		lastseen[id] = target
}

public SeenPlayer(id)
{
	new name[33]
	get_user_name(lastseen[id],name,32)
	if (lastseen[id] != 0)
		client_print(id,print_chat,"You last saw %s who currently has %d health.",name,get_user_health(lastseen[id]))
	else
		client_print(id,print_chat,"You have not seen anyone since your last the last time you spawned.")
}

public client_disconnect(id)
{
	lastseen[id] = 0
}

public resetHUD(id)
{
	lastseen[id] = 0
}
You don't need to add me in the credits.

EDIT: Errrm, left something out when I originally posted.
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.

Last edited by Lord_Destros; 02-05-2007 at 22:42.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-05-2007 , 23:11   Re: Last Seen Player
Reply With Quote #5

Ok, I shall PM you.

Read.
Phantom Warrior is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-07-2007 , 22:58   Re: Last Seen Player
Reply With Quote #6

Lord Destros, you're method won't work. With this you have to actually aim at them in order to "see" them. When in reality you can see them without aiming at them. Just use is_in_viewcone() in a player loop.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 02-08-2007 , 00:09   Re: Last Seen Player
Reply With Quote #7

Quote:
Originally Posted by Zenith77 View Post
Lord Destros, you're method won't work. With this you have to actually aim at them in order to "see" them. When in reality you can see them without aiming at them. Just use is_in_viewcone() in a player loop.
I intentionally did it so that you have to aim at them (with cross hair). Theres a few game play issues with your method.

1. When you use the command you probably want to see the person you just shot remaining HP. Not the person you last saw (which may be an ally or simply a person you don't care about).

2. I'm not sure if your method would work if there are 2 people in your view.

3. Gaben.

Adding a cvar may not be bad however........
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
lunarwolfx
Member
Join Date: Feb 2005
Old 02-08-2007 , 00:15   Re: Last Seen Player
Reply With Quote #8

Quote:
2. I'm not sure if your method would work if there are 2 people in your view.
It'll just take whatever player is looped last in the view cone.
lunarwolfx is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 02-08-2007 , 09:14   Re: Last Seen Player
Reply With Quote #9

Or, you could just take the closest one.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 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 00:39.


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