Raised This Month: $32 Target: $400
 8% 

Alternative to user_kill()?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 04-27-2009 , 15:15   Alternative to user_kill()?
Reply With Quote #1

I'm looking for a way to instantly kill a player (meaning without the delay of user_kill()) and a custom DeathMsg, which I'm still not sure how to do either. Someone help me with all of this? ^_^
Spunky is offline
Send a message via AIM to Spunky
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2009 , 15:19   Re: Alternative to user_kill()?
Reply With Quote #2

You could try Ham_Killed. And you want to create your own custom deathmsg if I understand well ?
Arkshine is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 04-27-2009 , 15:23   Re: Alternative to user_kill()?
Reply With Quote #3

That's right, and Ham_Killed just hooks their death, right? I'm trying to kill them.
Spunky is offline
Send a message via AIM to Spunky
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 04-27-2009 , 15:26   Re: Alternative to user_kill()?
Reply With Quote #4

Quote:
Originally Posted by Spunky View Post
That's right, and Ham_Killed just hooks their death, right? I'm trying to kill them.
Ham_Killed happens when an entity is killed. If you call it, the engine will pick it up and do whatever it was supposed to do to kill the entity, won't it?
__________________

Community / No support through PM
danielkza is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 04-27-2009 , 15:31   Re: Alternative to user_kill()?
Reply With Quote #5

Ah. Hmm. So I just call it?

Code:
public plugin_init()     RegisterHam(Ham_Killed, "player", "fnKilled", 0) public fnExampleFunction(id)     fnKilled(id) // Kill user? public fnKilled(id) {     // Do stuff }

Basically?

Edit: That didn't work at all.

Last edited by Spunky; 04-27-2009 at 15:48.
Spunky is offline
Send a message via AIM to Spunky
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 04-27-2009 , 15:55   Re: Alternative to user_kill()?
Reply With Quote #6

Take a look at hamsandwich.inc and plugins that use HamSandwich to learn more.

PHP Code:
// ExecuteHamB if you want to be able to hook it in your plugin.
ExecuteHam(Ham_Killedid); 
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 04-27-2009 , 15:57   Re: Alternative to user_kill()?
Reply With Quote #7

Oh, duh. Thanks. Should have thought of that. x_x
Spunky is offline
Send a message via AIM to Spunky
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 04-27-2009 , 21:29   Re: Alternative to user_kill()?
Reply With Quote #8

Ok, error:

Quote:
L 04/27/2009 - 21:27:10: [HAMSANDWICH] Bad arg count. Expected 4, got 2.
Code:
ExecuteHam(Ham_Killed, id)
Spunky is offline
Send a message via AIM to Spunky
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-27-2009 , 21:45   Re: Alternative to user_kill()?
Reply With Quote #9

ExecuteHamB(Ham_Killed, victim, killer, shouldgib);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 04-28-2009 , 01:02   Re: Alternative to user_kill()?
Reply With Quote #10

Solved, nevermind. Fixed by passing id as killer id.

Last edited by Spunky; 04-28-2009 at 04:46.
Spunky is offline
Send a message via AIM to Spunky
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 15:28.


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